![]() |
Snake
A few things, this is very basic snake, nothing really fancy about it. I got bored so I made it. My GScript is very limited as you can see, thanks to Tig for answering a few questions along the way.
Since I am very new (this I would say, is probably the 5th thing I've ever really tried to do) I'd love for some constructive criticism. I'm sure there a a million things wrong (but hey, at least it works!), or inefficient about what I did, and if you could point out 1, 2 or all of them I'd be very happy. Some of my indenting got screwy when I copied and pasted, sorry. PHP Code:
|
good job Damix
its realy good |
I just slipped throught it, but here some small tips:
Instead of: if(blabla == 0) you can use if (!blabla) Oh and also, instead of: PHP Code:
PHP Code:
|
Excellent!
|
Instead of doing...
PHP Code:
PHP Code:
|
Quote:
Quote:
|
Quote:
Extraneous information: There's no real reason why 0 is false and 1 is true. It just happened; that's why it's good practice to use true/false. Apart from better communicating your intention, Stefan might go mad and change the engine so that the number 7 is true and number 3 is false. |
Quote:
|
Quote:
|
Quote:
|
Quote:
In graal, there's no such thing as true booleans :( |
Quote:
Hmm... PHP Code:
|
Quote:
0 is 0 1 is 1 10 is 2 11 is 3 etc. This information is then utilized accordingly to perform specific actions. |
Quote:
You are right, there is no reason why I couldn't say 1000 and 5000 are true and false instead, it is just easier for me to say 1 is on and 0 is off then it is to say true is on and false is off. That is the way I learned it. I will admit that true/false makes more sense then 1/0 (because if you are using an integer it could conceivably be set to not 1 or 0,) but what is familiar will always hold true to the programmer. |
All times are GMT +2. The time now is 01:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.