Computer Science Canada Help in Snake thing... |
Author: | lebigcheese [ Sat Jan 08, 2005 12:24 am ] | ||
Post subject: | Help in Snake thing... | ||
Hi...Please help me with my snake game....i checked the already posted snake game by LiquidDragon. However, I hav NO idea what he was doing with his code. Anyways....i got the snake moving and eating its food, but i cant seem to make the snake build up everytime it eats something...please help as soon as possible... Here's my code:
|
Author: | SuperGenius [ Sat Jan 08, 2005 9:35 am ] |
Post subject: | |
i would suggest that you use flexible arrays to store the coords of each piece of the snake's body. when it eats some food or whatever increase the size of the arrays by 1. the thing about this is that it would be best to use a flexible 2-d array, but last time i checked turing does not support this. |
Author: | Cervantes [ Sat Jan 08, 2005 10:25 am ] |
Post subject: | |
Turing does support two-dimensional flexible arrays, though it is limited. You can only change the upper bounds of the FIRST portion of the array, not the second. You can read up oin Flexible Arrays here. |
Author: | lebigcheese [ Sat Jan 08, 2005 4:18 pm ] |
Post subject: | |
I can't use flexible arrays because this is a project and we didn't learn that in school yet, and teacher doesn't allow us to use things we didn't learn...we DID learn about arrays n 3d arrays but thats it...no flexible ones |