Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 92 users online: 2 members, 65 guests and 25 bots. Members: gbl08ma. Bots: Spinn3r (3), Magpie Crawler (3), Googlebot (19).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
Weregoose

Cemetech Expert

Joined: 23 Oct 2009 Posts: 463
|
Posted: 29 Nov 2011 04:10:32 am Post subject: Weregoose Makes a Snake Clone |
|
|
Because snakes are cool.
PROGRAM:BMAMBA (Download) [Pastebin'd slower, non-finance version]
:FnOff
:ClrHome
:ClrDraw
:GridOff
:AxesOff
:PlotsOff
:ZStandard
:84→Xmin
:-72→Ymin
:ZInteger
:30→nMin:30→PV
:46→nMax:44→FV
:26→I%
:Horizontal 0
:Vertical 0
:Vertical 94
:Horizontal Ymin
:Pxl-On(30,45
:For(n,0,E9
:2randInt(1,30→P/Y
:2randInt(1,46→C/Y
:0
:Repeat pxl-Test(nMin,nMax
:If Ans
:Then
:PV+2(pxl-Test(PV+1,FV)-pxl-Test(PV-1,FV→PMT
:FV+2(pxl-Test(PV,FV+1)-pxl-Test(PV,FV-1
:Pt-Off(FV,-PV,3
:Ans→FV
:PMT→PV
:End
:getKey
:If Ans
:Ans→I%
:(I%=34)-(I%=25→PMT
:(I%=26)-(I%=24
:Pxl-On(nMin+PMT,nMax+Ans
:Pxl-On(nMin,nMax
:Pxl-On(P/Y,C/Y
:nMax+2Ans→nMax
:nMin+2PMT→nMin
:End
:If nMin=P/Y and nMax=C/Y
:End
:Disp "Score:
:Output(1,7,n
Note: Optimizing was geared solely towards speed. _________________ Common Errors in English · How To Ask Questions The Smart Way |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55741 Location: Earth, Sol, Milky Way
|
Posted: 29 Nov 2011 12:55:45 pm Post subject: |
|
|
I was going to ask what you have against [code] boxes until I noticed what you were doing with the italics. If I recall, SourceCoder has symbols for those, but I'll have to double-check. I'm looking at this, and I'm not quite seeing how it would properly erase the end of its tail. Would you care to clarify how that works without a list of previous coordinates? _________________
 |
|
| Back to top |
|
|
Weregoose

Cemetech Expert

Joined: 23 Oct 2009 Posts: 463
|
Posted: 29 Nov 2011 06:59:35 pm Post subject: |
|
|
| KermMartian wrote: | | I'm looking at this, and I'm not quite seeing how it would properly erase the end of its tail. Would you care to clarify how that works without a list of previous coordinates? |
(PV,FV) chases (nMin,nMax)'s breadcrumbs! The coordinate-step holds that the former won't be misdirected by the head brushing against the tail.
Thank you for having the forethought to keep the code as-is. I had originally planned to use SourceCoder, but it doesn't cooperate during export with those variables in there. _________________ Common Errors in English · How To Ask Questions The Smart Way |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55741 Location: Earth, Sol, Milky Way
|
Posted: 30 Nov 2011 02:18:04 am Post subject: |
|
|
I figured it was something like that, but I'm unfamiliar with the term coordinate-step. Should I JFGI, or would you mind explaining? _________________
 |
|
| Back to top |
|
|
Weregoose

Cemetech Expert

Joined: 23 Oct 2009 Posts: 463
|
Posted: 30 Nov 2011 04:03:06 am Post subject: |
|
|
I pulled the term out of thin air, but a glossary entry from an affiliate of the Department of Health and Human Services shares the intended significance and states it beautifully thus: "The interval spacing between two successive points." That is, the snake body moves two pixels at a time, drawing at the neck as well as the head once per iteration. _________________ Common Errors in English · How To Ask Questions The Smart Way |
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.030373 seconds.
|