Author Topic: CSE BASIC Graph Screen Snake  (Read 6213 times)

0 Members and 1 Guest are viewing this topic.

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #15 on: July 30, 2013, 09:58:37 am »
lol. On another note, testing the snake going from the far left to the far right of the screen - Merthsoft was in ~10 seconds, and mine was in ~13.5 seconds. Divide my time by 3 (points to pixels) and multiply by 2 (me going every other pixel), and mine is ~10% faster than his. I've shown that lists, even when not using calculations with them, are slower than static variables. :P but ticalc needs a collection not infested by 4 times as many snake games as other games... idk should I work on flushing this out, or should I move onto other things?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: CSE BASIC Graph Screen Snake
« Reply #16 on: July 30, 2013, 01:36:21 pm »
You should probably add more features and stuff or you could just call it something like Fast Snake, so that while the game is more simple, it advertises that it's smoother and smaller, for people who want the smallest possible game. However I would suggest remaining respectful to other coders who spend their free time contributing to the community by not directly attacking their respective snake clones in your readme or something like you did a few posts above (although you can brag about your features/speed/size), else this might actually give you a bad community reputation and reduce your audience (an example is members who used to troll Omni in the past now rarely get replies to their projects). Plus, maybe your game could be taken down/flagged for innapropriate content like that (like what happened to Schoolhacker's programs).
« Last Edit: July 30, 2013, 04:31:28 pm by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: CSE BASIC Graph Screen Snake
« Reply #17 on: July 30, 2013, 04:24:52 pm »
Fancy. I remember the first calc game everyone at our school played was snake. I believe it was made in basic, but the program was protected and hidden from the editor. Great there is one for the CSE now too.
If you like my work: why not give me an internet?








Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #18 on: July 30, 2013, 04:53:59 pm »
Fancy. I remember the first calc game everyone at our school played was snake. I believe it was made in basic, but the program was protected and hidden from the editor. Great there is one for the CSE now too.
Lol that was Mario at my school. Then I went nuts with calc games and distributed a  lot to my friends and non-friends. :P

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: CSE BASIC Graph Screen Snake
« Reply #19 on: July 30, 2013, 05:32:27 pm »
First game I saw that wasn't mine or transfered by me was a snake on Ti-82 Stats! ;)
But let's go on the topic, I have a question:

How do you do the pathfinding? Your snake doesn't move pixel per pixel, right? What's his speed? 2px/frame?

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #20 on: July 30, 2013, 07:30:18 pm »
@DJ_O - I wasn't really attacking, just commenting that lists are slower. Of course, with a list, you can do things that my code can't do - specifically, make sure that the food isn't generated on the snake body. But personally, I don't like them for speed reasons. I was comparing to Merthsoft because his is a really good standard to compete with. No disrespect meant.
@Eiyeron - pxl tests. I move 2 pixels at a time, yes.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CSE BASIC Graph Screen Snake
« Reply #21 on: July 31, 2013, 12:27:53 am »
AH I see, just making sure since in your post on the other page it seemed like you thought that a snake game is completely worthless just if it uses lists, no matter how rich in features the game is, while in fact it's the most efficient way (although not speed-wise) to do a snake game when it comes to collision detection (even moreso if you use the home screen, where pxl-test collision is impossible). There were people in the past who said that any calc game that uses more than one file is a total piece of garbage, no matter if the coder had the choice or not (for example, good luck making a BASIC Pokémon that doesn't suck using one single program, no list and no pic). >.<
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #22 on: July 31, 2013, 12:31:46 am »
Haha no, I'm not one of those people. Any piece of code that an author worked hard on is worth a lot, even if it's just a Hello world prog or another quadratic formula.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CSE BASIC Graph Screen Snake
« Reply #23 on: July 31, 2013, 12:39:10 am »
Well I would probably not say that Hello World is very worthy of download, but if it helped the coder learn it's good, and hopefully he makes better programs eventually.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #24 on: July 31, 2013, 02:03:30 am »
How do you do the pathfinding?
If I understand the code correctly, for each frame, he gets the new coordinates of the tail by pixel-testing around the old coordinates of the tail (so he can erase the old coordinates for this frame and he has the new ones for the next frame).
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #25 on: July 31, 2013, 09:58:44 am »
Absol-utely correct! It should be noted that the idea for this pathfinding tail eater didn't come from me... it came from Weregoose. I simply coded it.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: CSE BASIC Graph Screen Snake
« Reply #26 on: July 31, 2013, 07:30:45 pm »
Clever thing. (Casio calc have a very slow Pxl-Test, so we program without it)

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #27 on: July 31, 2013, 07:45:26 pm »
Yes. The information already has to be on the screen, so you might as well access that information rather than create a second database of information.
 What's the resolution of your Casio calc? If it's very large, that may have something to do with the slow testing. idk

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: CSE BASIC Graph Screen Snake
« Reply #28 on: July 31, 2013, 09:00:54 pm »
Update - added a pause function and it now displays the screen. Also, I actually looked at Weregoose's code and found a few optimizations I could make, while getting this from him:
Quote
Based on a program written by Weregoose from http://www.cemetech.net

That in the program description would make me happy.
So I added it as a comment to my code, adding bytes to the size to 512 lol. I'll upload it when I find my cord.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CSE BASIC Graph Screen Snake
« Reply #29 on: July 31, 2013, 09:33:17 pm »
Yes. The information already has to be on the screen, so you might as well access that information rather than create a second database of information.
 What's the resolution of your Casio calc? If it's very large, that may have something to do with the slow testing. idk
I think it's a glitch or Casio really screwed up. When using a drawing command (no matter which one), there is a 0.3 second delay before it appears. The LCD is not that much larger than the CSE and the processor is actually faster.

Update - added a pause function and it now displays the screen. Also, I actually looked at Weregoose's code and found a few optimizations I could make, while getting this from him:
Quote
Based on a program written by Weregoose from http://www.cemetech.net

That in the program description would make me happy.
So I added it as a comment to my code, adding bytes to the size to 512 lol. I'll upload it when I find my cord.
Yeah this might be a good idea (as it is whenever you re-use some code or inspire yourself greatly from it or the program). I would recommend moving this to the readme or program description rather than comments, though, because BASIC comments slows down program execution (since it stores a string to Ans)
« Last Edit: July 31, 2013, 09:34:04 pm by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)