Computer Science Canada Da Snake.. problem with the flexible array.... |
Author: | santabruzer [ Tue Feb 10, 2004 11:04 pm ] | ||
Post subject: | Da Snake.. problem with the flexible array.... | ||
here is the most ineffiecient program i have written in my programming career.. and i mean it.. ..... fix if you can ![]()
|
Author: | Paul [ Tue Feb 10, 2004 11:08 pm ] |
Post subject: | |
oooOOOoo I love it, I'll save this for further consultation. Though when you press a key in the opposite direction your going, you loose. And by how much does it grow ? |
Author: | santabruzer [ Tue Feb 10, 2004 11:09 pm ] |
Post subject: | |
it grows by one.. but ofcourse in the 20 min i had when i wrote this prog.. i stuck to the basics.. mod it.. ![]() |
Author: | DanShadow [ Wed Feb 11, 2004 4:04 pm ] |
Post subject: | |
hmm...why dont you just save the (x,y) co-ordinates in a record array or something. I just found out about records a month ago, and now use them in pretty much every program I do. ![]() I did that program awhile ago, just by recording the (x,y) co-ordinates in a normal array, and redrew them. But if the (x or y) co-ordinate of the head of your snake is equal to the (x or y) co-ordinate of any part of the tail of your snake...you lose.[/code] |
Author: | santabruzer [ Wed Feb 11, 2004 4:22 pm ] |
Post subject: | |
firstly.. i did use a record array.. secondly that would be acceptable if the first part of the snake is with contact with the last part of the sanke.. ... iono... a array matrix is so much easier.. .. and have it like an X, Y co-ordinate.. if that is what you mean.. but what you suggested.. i know.. i just wanted to build something with "whatdotcolor"... any ideas to the flexible array on the sanke.. it basically stops working after 10 of those things are eaten.. saying that a varaible is not passed.. but yet.. i do pass it.. so i have no idea.. |
Author: | McKenzie [ Wed Feb 11, 2004 11:06 pm ] | ||
Post subject: | |||
All too easy. Simple mistake Santa: Quote: lsnake := lsnake + points div 5
should be:
I think you see why ![]() |
Author: | santabruzer [ Wed Feb 11, 2004 11:16 pm ] |
Post subject: | |
well.. excellent.. apparently.. i wanted it to happen.. and i forgot after i put the trigger in that i can just remove the points div 5.. wow.. i'm really amazed someone actually read that long program.. in that sloppy format.. with three trigger ![]() |
Author: | McKenzie [ Thu Feb 12, 2004 8:38 am ] |
Post subject: | |
You'd be surprized just how many snake programs I've read over the years ![]() |
Author: | the_short1 [ Thu Apr 08, 2004 10:58 pm ] |
Post subject: | |
OMG!!! i love it.... very nicde,... smooth.... i will make a .,exe for my sis... she LOVEs this game..... only thing i would change is get rid of the hidous buttonbar..... good game... i dont care if its uneficeint |