Results 1 to 2 of 2
Thread: GridWorld BinaryBug Program Help
- 04-10-2014, 03:50 PM #1Member
- Join Date
- Feb 2014
- Seattle, Washington
- Rep Power
GridWorld BinaryBug Program Help
Design and implement a new bug that will extend the bug class. This bug will be called “BinaryBug”. The way this bug will work is that each time that it steps towards a direction it will be considered a 0 in a string of binary numbers. Whenever it runs into another bug or flower it is going to hop over the bug and that will add a 1 to the string on numbers. If there are multiple objects in a row that need to be hopped over, the binary bug will have the ability to do so. When the binary bug reaches the end of a bounded grid, or reaches a rock, it will display the string of the binary number. It will then turn to a direction in which it is free to move and start over. If the bug runs into an object that it needs to jump over, but the jump would put it off the grid, then it will also finish its path.
This program is giving me some trouble and i need to know where to get started. i feel like i should try to use the getNeighbors or getOccupiedAdjacentLocations methods to check for the spaces around it to make sure the binary bug doesnt have to jump over another object on the grid.
Thanks in advance for any help!
- 04-10-2014, 04:33 PM #2
- By Estrex in forum New To JavaReplies: 0Last Post: 03-28-2013, 10:54 AM
- By Green_Ghoul in forum New To JavaReplies: 2Last Post: 05-03-2011, 02:00 AM
- By Samirjthe2nd in forum New To JavaReplies: 1Last Post: 04-28-2011, 10:10 PM
- By BJ1110 in forum Advanced JavaReplies: 9Last Post: 02-04-2011, 05:02 PM
- By robertbob in forum New To JavaReplies: 2Last Post: 05-03-2010, 05:18 PM