Create functions to simplify your code

Assignment Help Python Programming
Reference no: EM13755706

Please implement each function SolveN. The number at the end of the function name specifies which game it is solving. Example: Solve2 is called to solve game 2.

If you would like to see the games look at gamedefs.py. DO NOT MODIFY gamedefs.py.

All of your code should be implemented in the robot.py file.

- Solve each game.

- Create functions to simplify your code. If you find yourself writing the same code over and over again, it should probably be made into a function.

- Consider using loops for repetitive task.

- Be creative with your solutions! There are many ways to solve these puzzles so

I am expecting unique solutions. I will be comparing students work!

- Try to keep your solutions a simple and small as possible. Keep working until you are proud of your solution.

- Use any programing concepts we have learned in class.

- Use the built-in functions (detailed below) to manipulate the bot.

Built-in Functions:

TurnOn - Turns on your bot.

TurnOff - Turns off your bot

TurnLeft - Turns the bot left. (Not there is NO TurnRight can you fix this?)

Move - Moves the bot it the direction that it is facing.

PickUp - Picks up one pickup (purple circle) the bot is standing on.

PutDown - Puts down one pickup if the bot is holding any.

IsAtPickUp - Returns True if the bot is standing on a pickup. False otherwise.

IsAtDeposit - Returns True if the bot is standing on a deposit block. False otherwise.

IsAtEnd - Returns True if the bot is standing on the end block. False otherwise.

IsClearAhead - Returns True if the bot has a clear path in the direction it is facing.

False otherwise.

IsClearLeft - Returns True if the bot has a clear path on the left. False otherwise.

IsClearRight - Returns True if the bot has a clear path on the right. False otherwise.

HasPickUps - Returns True if the bot is holding pickups. False otherwise.

HasError - Returns True if the bot encountered and error and failed. False otherwise.

Rules:

- The bot must be turned on to perform any instructions.

- The bot must be turned off the end.

- The bot must be on the end block at the finish of the game.

- The bot can not be holding any pickups at the end of the game.

- All pickups must be placed on a deposit at the end of the game.

- All deposits must have at least one pickup on it at the end of the game.

- The bot can not try to move through a wall.

Notes on the files:

- You only need to work in the robot.py file.

- The .pyc files are compiled python files. They are in byte code and you won't be able to read them.

- Do not modify any code besides robot.py

- You will only submit robot.py

Testing:

- Run main.py to test.

- Read the comments at the top of robot.py to learn what global variables you can change to affect testing.

- Report any bugs with the GUI to Sabrina or the TAs immediately.

- If the UI doesnâ€TMt come up, install Tkinter. Open up your terminal and type the following:

sudo apt-get install python-tk

Reference no: EM13755706

Questions Cloud

Assurance and legal accountability : Please respond to the following: Review the following reports in the 2014 Annual Report for Apple Inc. Discuss the reason we care about these reports; include the assurance and legal accountability provided by these disclosures and their relations..
What is the significance of ellis island : What is the significance of Ellis Island? What did the Immigration Act of 1924 do, and how did that differ from the Immigration Act of 1965?
What was the consequence of the munich conference : What was the consequence of the Munich conference?
Write paper that compare missouri state and us constitution : Write a paper that compare and contrast the Missouri state constitution, the US constitution, and the constitution of the country for which you will write a Country Profile Report(Vietnam).
Create functions to simplify your code : Create functions to simplify your code. If you find yourself writing the same code over and over again, it should probably be made into a function.
What was the result of the dominion of new england : Describe and discuss the Dominion of New England. When was it created? Who created it? Why was it created? What was the result of the Dominion of New England?
File transfer protocol : The File Transfer Protocol (FTP) uses which transport protocol, TCP or UDP
Explain whether tarbo has a dominant strategy : Explain whether Wal-World has a dominant strategy and explain whether Tarbo has a dominant strategy.
Positive and negative impacts of pbuse information system : In this essay discuss both the positive and negative impacts of PBUSE information system has on the users within an organization and provide three recommendations for improving the information system

Reviews

Write a Review

Python Programming Questions & Answers

  Let ll be a list of integers

Let LL be a list of integers. Use list comprehension to produce teh following lists. Each one should just take onel line. Anser questions as two comments.

  Write a function rmduplic(l), where l is any list

Write a function rmDuplic(L), where L is any list. The function should return a list M that contains the same items as L, except that repetitions (duplicates) have been removed: only the first occurrence of each entry is kept (i.e., order is prese..

  Write a function that will take two arguments

Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid and write code to read, in turn, each line of the file, remove the newline character and append the resulting string to a list of stri..

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Assume that the variables gpa , deanslist and studentname

Assume that the variables gpa , deansList and studentName , have been initialized. Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.

  Reinforce topic material on simple functions

Select 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program.

  Cleint software so that it does not display

Rewrite the cleint software so that it does not display an echo of a message sent by the users. Maybe it means that each time a user tries to send a private message that same message is also sent back to them? summary: stop that from happening?

  We would like to implement the lexical order

We would like to implement the lexical order for lists. For simplicity, we only consider lists of numbers, where , >= have their usual meaning.

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

  In this assignment you will write a program that does

in this assignment you will write a program that does simple packet routing. your program will take three command-line

  Design a function that accepts an integer

Design a function that accepts an integer argument and returns the sum of all the integers from 1 up to the number passed as an argument. For example, if 50 is passed as an argument, the function will return the sum of 1, 2, 3, 4, . . . 50. Use recur..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd