15 views

Uploaded by vil leu

CISC Course work, assignment 6

save

You are on page 1of 3

**a legal path through the hopscotch board containing the number of points in the list
**

Squares.

**2. Write a predicate called betterpath, where betterpath(pathi,path2,Better) means
**

that Better is either pathi or Path2 and is the path with the greater total number of

points. If pathi and Path2 have the same total number of points, Better can be either

one. Hint: the SWI-Prolog library contains a predicate called sum list, where

sum_iist (List, sum) means that if List is a list of numbers sum is the sum of all the

numbers in the list.

3. Write a predicate called bestpathofList, where bestpathofList (ListofPaths,Path)

means that path is the path in Listof Paths with the greatest total number of points. If

there is a tie, you can resolve it however you like.

4. Use setof and your legaipath predicate to build a list of all the legal paths through a

hopscotch board. Then use bestpathofList to find the best path in that list of paths. (I

discussed the setof predicate in class on Friday, March 21. For the large number of you

who weren't in class, you can wait for the video which will be posted on Saturday the

22nd, or look up setof in your text.)

This is not the only way to solve the problem. Any hopscotch predicate that words correct for

all our test cases will receive full marks. If you're having trouble, though, this is a suggestion

for breaking down the problem, and we will give partial credit if you can get some of those

helper predicates working even if they don't all work.

Administrative Details:

To make it simpler for us to mark your assignments, you must put your hopscotch predicate,

plus helpers (if any) into a single file called Assignments.pi.

Marking Scheme:

This assignment will be marked out of 16 points. If you use the breakdown suggested above,

we will divide the points as follows:

legaipath: 4

betterPath: 4

bestPathOfList: 4

**putting everything together to create a correct hopscotch predicate: 4
**

If you solve the problem a different way, you get all 16 points for a hopscotch predicate that

works correct with all of our test cases. If you didn't manage to get a working hopscotch

predicate, we'll give you partial credit according to how far you got.

Remember that we may deduct an administrative penalty if you do not follow the instructions

in the Assignment Requirements page.

There are no style points for this assignment, but as always if you discipline yourself to write

clearly, with meaningful names for your predicates and parameters -- and even include a few

http://research.cs.q ueensu.ca/home/cisc260/2014w/assig nments/assn6/assn6.html

21

Identifying yourself in the header comment is important to help us make sure that the right mark goes to the right person.hs contains several examples of hopscotch boards and their best paths. just to make sure that your functions aren't tailored specifically to these examples. Ontario.queensu.html . it's particularly important that you give a clear explanation for what each of your helper predicates is supposed to do.it will help you keep things straight and get your code working. we will deduct an administrative penalty. If you follow a different scheme than the one I suggested above and it's not all working. the header comment at the beginning of the program is a requirement.cs. The TAs will be using different examples to tes your predicate. Some Examples: AssnZExamples. This page maintained by Margaret Lamb. so that we can evaluate each one separately. Queen's University. Kingston. They apply to this assignment too. Last modified 03/22/2014 02:34:29 http://research.3/21/2014 Assignment 6: CISC 260 Winter 2014 comments -. Even though you won't earn style points for this assignment. It also makes it easier for you to get help when you need it. If you don't have a comment at the beginning identifying yourself (by name.ca/home/cisc260/2014w/assignments/assn6/assn6. student number or NetID) and the other members of your group if applicable.

Write a predicate called legaipath.1. on Saturday. Best = [7. there are some aspects of Prolog that make this problem simpler to solve (at least. In Prolog.q ueensu. Here is an example using my solution: I ?. 3] . though. These detail all of the general administrative stuff you need to know about assignments for this course. And finally. Please make sure you have read the general Assignment Requirements for CISC 260 before beginning this assignment.Best). If you're having trouble.html 1/3 .2. Kingston. you must solve the same Hopscotch puzzle as you did for Assignment 2. path) means that Path is the best legal path through a hopscotch board if the squares in the board contain the numbers of points in the list squares. take a deep breath! First. By best path.ca/home/cisc260/2014w/assig nments/assn6/assn6.m. If you found Assignment 2 difficult. where hopscotch (squares. false.9. Winter 2014 Queen's University. you will get full correctness points. what is required.6.5. Instead of re-stating the basic problem.hopscotch([7. March 29 General questions about this assignment (administrative details. so I don't have to repeat them for each assignment. For this assignment. Please help your fellow students find Q&A about this assignment by using this designated forum rather than the general forum.cs. but this time you must do it in Prolog. just the path. If your hopscotch predicate works without error. where legaipath (squares. You don't have to indicate the total number of points. I'll refer you to the explanation given with Assignment 2.3/21/Z014 Assignment 6: CISC 260 Winter 2014 Assignment 6: Hopscotch In Prolog CISC 260. you can pattern your solution after the Haskell solution I've posted on Moodle so you have a head start. here is a suggested strategy: 1. 5. 6.3]. You may assume that the first parameter of hopscotch will be bound. what you must write is a predicate called hopscotch. I mean the path with the largest total number of points. Path) means that path is http://research. Ontario back to CISC 260 Moo die site This Assignment is due by 8 a. etc) should be directed to the Assignment 6 Moodle forum.4. in my opinion). It helps you think about what ideas are common between the two and what's different. Please do not post Prolog code or even pseudo-code on Moodle. I think it's a very useful experience to solve the same problem in both languages. Second.

- 10.1.1.54.7045Uploaded byИлья Кудрявцев
- lesson plan romeUploaded byapi-345690994
- Syntax and meaning of prolog programsUploaded byLuis Lopez
- tradesimulationlpUploaded byapi-285289950
- SWI PrologUploaded bydrom
- 12Uploaded byapi-348891251
- Cognos RS - 4Uploaded byHarry Konnect
- DAFTAR PUSTAKAUploaded bywidya
- Arpapel Formas Customer Bank Exc Int - 4Uploaded byDuke Lajaulaazul
- BGI_order_track_testplanUploaded bySridhar Chalasani
- asma 3b lesson plan 14th march 2017Uploaded byapi-346601484
- Interbase KbUploaded byrabindra
- bmeyerUploaded bynotg
- 1 prolog 01-06-2012Uploaded byA B M Moniruzzaman Khan
- Tutorial 12Uploaded byVictoria Love
- outlineUploaded byapi-253671896
- lesson planUploaded byCam Jays
- Review Teachers and Learner RectionsUploaded byeduordox
- CriteriaUploaded byDarling Mallari
- sarah plain and tall dominican lesson planUploaded byapi-237490691
- 3 Golden Rules for Effective CommunicationUploaded byYateen Gharat
- Dinamicas RompehieloUploaded byJacqueline Vera Puente
- Assignments Q4 W1 910Uploaded bynpriester
- rphUploaded bypamie1981
- tarunUploaded byTarun Kinger
- The Process of Preparing Effective Business MessagesUploaded byQaiser Saleem
- Lesson PlanUploaded bynameless031
- hw 11-4-13Uploaded byapi-236313651
- Project Coin Features in Java 7Uploaded byAbhishek Asthana
- Notes English on WritingUploaded byNcnagesh Prasad

- SAP PI Transaction Codes ListUploaded byVikas
- PLSQL1Uploaded byJustin Witt
- Add-On on rslogix 5000Uploaded byjarckled
- Semester 2 Midterm ExamUploaded bydaemon29
- NOMBRE: Carlos Augusto Estrada Cortez Liceo MetropolitanoUploaded byabccll
- D17366GC10_TOCUploaded byRapid Chase
- bölmeUploaded bydamla_6167
- UML paso a paso bien explicadoUploaded byjpsystem
- U2ehsx26SzGNXZC9o8zs_Curso Data Analytics Con Hadoop. FcoJavierLahozSevilla v1.0_NUEVAUploaded byEdwin Quevedo Quispe
- CI Dengan Jquery UIUploaded byKaptenSigit
- ASP.net Life CyclesUploaded byPGBaalaji
- Haml and Sass in 15 minutesUploaded byBest Tech Videos
- ArraysUploaded byNurul Syahirah Sulaiman
- rdbmsUploaded byAlfyong Guadz
- Comandos Batch en WindowsUploaded byantornio
- Fundamentals of OOPS ProgrammingUploaded byPradeepta Kumar Sethi
- MinimalismUploaded by.xml
- Lecture 1Uploaded byAamir Mahmood
- VBA TutorialUploaded byPanagiotis Platis
- ANEXOSUploaded byMarco Antonio Villa Cabero
- ChocolateUploaded byshantana4
- IBM Mainframe - Cobol MaterialUploaded byusersupreeth
- chtp7_AppFUploaded byh_hab
- Scss Style SheetsUploaded byMuthusankaranarayanan Valliammal
- Uml and Dp ManualUploaded byLavanya_123
- IDOCSUploaded bynaanakadalu
- RubyfuUploaded bybono
- Teoría de la Programación Orientada a ObjetosUploaded bythe_coolboys
- Jasper iReport Em Portugues Excelente Apostila Curso Completo de Java iReportUploaded byAnna Carolina Oliveira
- JavaUploaded byivan