What is CodeBot?
CodeBot is a complex game with a simple objective: collect every black square using programming instructions provided to a robot. Be careful, as you're only provided with a limited number of instructions on each level, which means you'll have to become an efficient programmer to complete each puzzle!
|
Here's the download!
|
Did you like CodeBot? Give your feedback here.
Project History
March 29, 2018
March 30, 2018 March 31, 2018 April 2, 2018 April 4, 2018 April 7, 2018 |
Game concept explored, first line of code written!
Unstable release of first 5 levels published to Weebly. 14 total levels now exist, with stability improvements implemented. CodeBot is now considered stable, but unfinished. 20 levels have now been published to Weebly. An installer for CodeBot has been published. 25 levels have now been published to Weebly. CodeBot is considered finished for the time being. |
Hints
Stuck on a level? Fine...we'll give you hints...in exchange for cookies! Just kidding, we're not starving. Of course, this game is much more enjoyable if you use these hints as little as possible, but just in case you're really up against a wall, here you go!
Level 1:
The target is six spaces in front of you, so just give that DRIVE button some love!
Level 2:
You'll need to drive forward before turning. Don't feel like you have to count exactly - you can check to see if you got the correct number of drive statements by testing out your robot. Turn a second time after driving forward some more.
Level 3:
The number of lines of code provided is the exact number you'll need. Counting can be difficult here, so do your best to keep track of your code. Drive forward the exact number needed, turn, and repeat.
Level 4:
Place your drive commands in between the "Sub f1()" and "End Sub" lines of code, then use that function by typing "f1" in the black textbox. Oh, and don't forget to point your CodeBot in the right direction.
Level 5:
Just like level 4, you'll need to put your drive commands (as well as a turn) inside f1. Then, just call f1 three times in your main code section.
Level 6:
Again, all driving and turning will be inside the f1 function. You'll need more drive commands than seems necessary at first, because since you're reusing your code, those drives will be necessary later. So, don't be alarmed if CodeBot is hitting the wall a few times at the beginning of the trial. Use the function five times in the main body of code.
Level 7:
Turn left by typing "turn(L)". So, you'll just be alternating between turning left and right while driving forward.
Level 8:
You can turn around directly by typing "turn(B)" - the "B" stands for "Back." Don't forget to face the right direction at the beginning.
Level 9:
You only need one drive command inside your loop. Loops work by counting from the first number to the last number. So, going from 1 to 5 would loop a total of 5 times. Also, since the level will be completed the moment you pick up the black square, you don't really need to worry about repeating the loop too many times.
Level 10:
Your main body of code should just loop over the f1 function a bunch of times. Then, in your function, drive forward, turn left, drive forward, and turn right. Since your function is being repeated, that will be enough to get CodeBot up to the top.
Level 11:
If statements work by checking to see if something is true. If it is, the code inside the if statement will run. If not, the code will be skipped over, up to the closing "End If" statement. The default "True" will always allow the if statement to run, so change that to something that may or may not be true depending on the circumstances around CodeBot. Feeling to the right will detect when CodeBot has reached an opening. So, you need to create a loop that will run many times. Inside this loop, place an if statement. When you don't feel a wall to your right (hence the "false"), you'll need to turn to the right. Additionally, outside of your if statement, you'll need a drive command to make sure CodeBot still drives forward all the time.
Level 12:
This will work similarly to the previous level. If you feel no wall to your right, turn right. If you feel no wall to your left, turn left. The second feel will be next to the "ElseIf". Loop the whole process and you'll be in the clear. Make sure you delete the "Else" code to slim everything down to the correct number of lines of code.
Level 13:
A while loop works just like an if statement, except that it runs again and again until the condition becomes false. So, a for loop will run a set number of times, but a while loop will run until something in the code causes it to stop. So, you should have a while loop that continues to run as long as you feel a wall to your right. The moment you feel nothing, exit your loop, turn right, and drive forward.
Level 14:
At the top of your code, use the command "var = 0". This will create a variable and store 0 in it. Then, create a while loop that runs as long as var is less than 5. ("while var < 5"). Inside your loop, create an if statement that checks to see if you're next to a wall. If you're not, add 1 to var by typing "var = var + 1". Continue to drive forward until your loop stops, then turn and grab the square.
Level 15:
Nothing too complicated here, just drive forward several times. Note that your code is independently sent to every CodeBot on the field.
Level 16:
In order to avoid hitting the wall, you'll need to use a while loop that terminates when CodeBot feels a wall ahead. Just using a for loop that repeats 6 times will cause the bot on the right to crash into the wall.
Level 17:
Use a loop to drive forward. If you feel nothing to the right, turn right. If you feel nothing to the left, turn left.
Level 18:
The solution here is actually the same as level 17. If statements allow each bot to choose when to turn.
Level 19:
The code here will be very similar to level 14's solution. Use a variable to keep track of how many openings you pass by. You won't be able to just give an exact number to CodeBot since each one must travel a different number of spaces.
Level 20:
Determine the code required to grab one of the squares and return to the center. Place that code in f1, then loop f1 in your main code section four times.
Level 21:
Use a while loop to turn CodeBot until an opening is detected ahead, then drive forward one square.
Level 22:
This level is arguably one of the most difficult in the game. Use a for loop to drive to the center, then use f1 to drive CodeBot into one of the large "T" shapes. Call f2 twice to pick up the squares on each end, and get yourself back to the center. Repeat three times to grab all the squares.
Level 23:
Make up a variable name (such as x) and place it inside the empty parenthesis for f1. In f1, use a for loop that goes from 1 to x instead of 1 to a number. To call the function, type "f1(5)" or whatever number you need. Use your function to drive forward the correct number of spaces. You'll want to turn to the right first.
Level 24:
This level looks harder than it is. You need to visit every dead end in the maze with only a few instructions. You'll need to create a pattern that always follows either the left or right wall, and therefore takes every possible path through the maze. Create a for loop that repeats many times. In the loop, check to see if you're next to an opening. If you are, turn and drive. If you're not and there's no wall ahead, drive forward. If you can't drive forward, turn the other direction.
Level 25:
Use a variable to control how many times a for loop runs. Increase the variable by 1 each time the loop runs. You won't be able to navigate by feeling walls, because there are too many random gaps in the level.
Level 1:
The target is six spaces in front of you, so just give that DRIVE button some love!
Level 2:
You'll need to drive forward before turning. Don't feel like you have to count exactly - you can check to see if you got the correct number of drive statements by testing out your robot. Turn a second time after driving forward some more.
Level 3:
The number of lines of code provided is the exact number you'll need. Counting can be difficult here, so do your best to keep track of your code. Drive forward the exact number needed, turn, and repeat.
Level 4:
Place your drive commands in between the "Sub f1()" and "End Sub" lines of code, then use that function by typing "f1" in the black textbox. Oh, and don't forget to point your CodeBot in the right direction.
Level 5:
Just like level 4, you'll need to put your drive commands (as well as a turn) inside f1. Then, just call f1 three times in your main code section.
Level 6:
Again, all driving and turning will be inside the f1 function. You'll need more drive commands than seems necessary at first, because since you're reusing your code, those drives will be necessary later. So, don't be alarmed if CodeBot is hitting the wall a few times at the beginning of the trial. Use the function five times in the main body of code.
Level 7:
Turn left by typing "turn(L)". So, you'll just be alternating between turning left and right while driving forward.
Level 8:
You can turn around directly by typing "turn(B)" - the "B" stands for "Back." Don't forget to face the right direction at the beginning.
Level 9:
You only need one drive command inside your loop. Loops work by counting from the first number to the last number. So, going from 1 to 5 would loop a total of 5 times. Also, since the level will be completed the moment you pick up the black square, you don't really need to worry about repeating the loop too many times.
Level 10:
Your main body of code should just loop over the f1 function a bunch of times. Then, in your function, drive forward, turn left, drive forward, and turn right. Since your function is being repeated, that will be enough to get CodeBot up to the top.
Level 11:
If statements work by checking to see if something is true. If it is, the code inside the if statement will run. If not, the code will be skipped over, up to the closing "End If" statement. The default "True" will always allow the if statement to run, so change that to something that may or may not be true depending on the circumstances around CodeBot. Feeling to the right will detect when CodeBot has reached an opening. So, you need to create a loop that will run many times. Inside this loop, place an if statement. When you don't feel a wall to your right (hence the "false"), you'll need to turn to the right. Additionally, outside of your if statement, you'll need a drive command to make sure CodeBot still drives forward all the time.
Level 12:
This will work similarly to the previous level. If you feel no wall to your right, turn right. If you feel no wall to your left, turn left. The second feel will be next to the "ElseIf". Loop the whole process and you'll be in the clear. Make sure you delete the "Else" code to slim everything down to the correct number of lines of code.
Level 13:
A while loop works just like an if statement, except that it runs again and again until the condition becomes false. So, a for loop will run a set number of times, but a while loop will run until something in the code causes it to stop. So, you should have a while loop that continues to run as long as you feel a wall to your right. The moment you feel nothing, exit your loop, turn right, and drive forward.
Level 14:
At the top of your code, use the command "var = 0". This will create a variable and store 0 in it. Then, create a while loop that runs as long as var is less than 5. ("while var < 5"). Inside your loop, create an if statement that checks to see if you're next to a wall. If you're not, add 1 to var by typing "var = var + 1". Continue to drive forward until your loop stops, then turn and grab the square.
Level 15:
Nothing too complicated here, just drive forward several times. Note that your code is independently sent to every CodeBot on the field.
Level 16:
In order to avoid hitting the wall, you'll need to use a while loop that terminates when CodeBot feels a wall ahead. Just using a for loop that repeats 6 times will cause the bot on the right to crash into the wall.
Level 17:
Use a loop to drive forward. If you feel nothing to the right, turn right. If you feel nothing to the left, turn left.
Level 18:
The solution here is actually the same as level 17. If statements allow each bot to choose when to turn.
Level 19:
The code here will be very similar to level 14's solution. Use a variable to keep track of how many openings you pass by. You won't be able to just give an exact number to CodeBot since each one must travel a different number of spaces.
Level 20:
Determine the code required to grab one of the squares and return to the center. Place that code in f1, then loop f1 in your main code section four times.
Level 21:
Use a while loop to turn CodeBot until an opening is detected ahead, then drive forward one square.
Level 22:
This level is arguably one of the most difficult in the game. Use a for loop to drive to the center, then use f1 to drive CodeBot into one of the large "T" shapes. Call f2 twice to pick up the squares on each end, and get yourself back to the center. Repeat three times to grab all the squares.
Level 23:
Make up a variable name (such as x) and place it inside the empty parenthesis for f1. In f1, use a for loop that goes from 1 to x instead of 1 to a number. To call the function, type "f1(5)" or whatever number you need. Use your function to drive forward the correct number of spaces. You'll want to turn to the right first.
Level 24:
This level looks harder than it is. You need to visit every dead end in the maze with only a few instructions. You'll need to create a pattern that always follows either the left or right wall, and therefore takes every possible path through the maze. Create a for loop that repeats many times. In the loop, check to see if you're next to an opening. If you are, turn and drive. If you're not and there's no wall ahead, drive forward. If you can't drive forward, turn the other direction.
Level 25:
Use a variable to control how many times a for loop runs. Increase the variable by 1 each time the loop runs. You won't be able to navigate by feeling walls, because there are too many random gaps in the level.