Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Reaction Timer...6LINES!!!

Author
Message
Sagax
12
Years of Service
User Offline
Joined: 3rd Apr 2007
Location:
Posted: 23rd Sep 2007 22:52
1:
cls:ink rgb(244,214,210),0:set cursor 230,0:print "Reaction Time":print:print "Keep your hand on the return key!"
print "When the word "now" appears, press the return key to stop the timer.":print:input "Press return to start";A$:CLS
ink rgb(255,0,0),1:left=(275):top=(250):ellipsewidth=(200):ellipseheight=(200):ellipse left,top,ellipsewidth,ellipseheight
ink rgb(255,255,255),1:print "On your mark...":sleep rnd(3000):print "Get set....":sleep rnd(3000):ink rgb(0,255,0),1:print "NOW!"
ink rgb(0,255,0),1:ellipsewidth=(200):ellipseheight=(200):ellipse left,top,ellipsewidth,ellipseheight:a=timer():suspend for key
b=timer():c=b-a:print c/1000.000;"seconds":ink rgb(255,255,255),1:print "TRY AGAIN?":suspend for key:goto 1

Attachments

Login to view attachments
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 24th Sep 2007 23:31
First of all, please put your code between two code tags like these only without the *s: [*code] [*/code].
That does this:

Right, that was a nice peice of begginer code, a lot less stupidly ambitious than most newbie codes. However, there were some little errors:
There is not man loop. (At least not that I can see...) All programs need a main loop.
You used goto. Gotos are BAD, full stop. Use gosubs insted. (Better hope TDK doesn't see this, gotos are his worst enemy)
A better way of organising it would be:
do
Gosub 1
loop
1:
Stuuf goes here
play again?
return

Much better. Finally, you didn't set a sync rate or turn sync on, meaning it will run at different speeds on different computers.
Overall, a nice bit of code though. Well done.

Our home is our world, our life, home is our world...
Homeworld: The ladder
aluseus GOD
12
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 1st Oct 2007 03:14
who is tdk? Some kind of OOP worshipper?

Your signature has been deleted by a moderator because this joke is getting old.
tha_rami
13
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 1st Oct 2007 05:25 Edited at: 1st Oct 2007 05:26
Uhm, TDK, you know, the guy who makes the new IDE, is a mod, writes lots of tutorials and knows what he's talking about? That TDK...

Nice code . Work, but indeed, could use some fixes - INH pointed most things out, so I recommend you read his post carefully.


A mod has been erased by your signature because it was larger than 600x120
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 1st Oct 2007 21:51
TDK is the ultimate dark basic deity, the god of all clean code, and our ultimate leader at the time of the great TGC apocolypse.

Quote: "Everyone's entitled to an opinion...but your opinions are wrong."

Pyramid Games Ltd
12
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 4th Oct 2007 16:28
Spammer....

I made you a cookie, but I eated it....
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 4th Oct 2007 21:00
Quote: "Spammer...."

Your post is more spam than mine. My post was relevant, because I answered a question (Admittedly unseriously). You didn't. Heck, your post is only one word!

Quote: "Everyone's entitled to an opinion...but your opinions are wrong."

Eevil Weevil
12
Years of Service
User Offline
Joined: 1st Aug 2007
Location: Wherever you are, I wil follow
Posted: 8th Oct 2007 18:26
I think aluseus GOD was j/king...

Excuse me. Yes you. Stop reading my siggy! It is private. Stoppit! Now! I'll kill you! Bleurgh! Go away or I'll format your C-drive! You are dead! I am dead! Yes! Ahem.
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 8th Oct 2007 18:35
Quote: "I think aluseus GOD was j/king..."


Quote: "Mon Mar 19th 2007"

Nah.



Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 9th Oct 2007 22:42
Quote: "Who said that? A program that is executed step by step does *not* need a main loop. A main loop is used to constantly update things, calling functions, and such."

Oops, I was getting mixed up with double loops.
Quote: "That's not better, it's even worse. You either jump to a label to start over, or you put all the code that should be repeated in a loop. Doing both is just stupid, especially the way you did it in that example. You don't create a main loop just in order to have one and then place the actual main code somewhere else."

Looking back, I can see what you mean.



Pyramid Games Ltd
12
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 10th Oct 2007 14:57
Quote: "Your post is more spam than mine. My post was relevant, because I answered a question (Admittedly unseriously). You didn't. Heck, your post is only one word!"


I was talking about Sagax moron.

Benjamin
17
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Oct 2007 18:23
Quote: "I was talking about Sagax moron."

Man, you really are a troll.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Pyramid Games Ltd
12
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 10th Oct 2007 20:25
I have sudden thoughts that you are towards me.

Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 10th Oct 2007 22:02 Edited at: 10th Oct 2007 22:04
Ouch, PGL, you started as a nice kinda fellow, but recently you've become really vindictive and mean. I mean, god, it is CODE, is it not? And reletively good, yes, for a first program? So how is it spam? And how am I a moron for making a mistake? Your post is right under mine, after all.
And don't offend Ben over there. His claws can be really sharp sometimes.

Pyramid Games Ltd
12
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 10th Oct 2007 22:32
I am sorry INH you me a bit mad when you said that and I wasn't talking about you. Forgive me....

Libervurto
13
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Oct 2007 21:11 Edited at: 11th Oct 2007 21:13
Hey Sagax
I liked some things about your code so I spent a while on it
hope this helps. You gave some good opportunities for me to lecture on logic and loops haha
You've been OBese'd


Libervurto
13
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Oct 2007 21:20
@Everyone
Here's a scancode list I made: it has the numbers for every key.
Should be useful to you guys


demons breath
16
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 16th Oct 2007 15:50
@ INH: You're commenting on his start date? It's BEFORE yours, is it not?

Also PGL they're right... you seem rather an angry sort of a bloke at the moment.

And what's MOST ironic is that aluseus GOD is a member of the ANJL - there's something wrong with here. Warn them - they've been infiltrated by the very people they fight against!

By the way, what does aluseus mean? Just out of interest...

http://jamesmason01.googlepages.com/index.htm
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 16th Oct 2007 18:51
Quote: "You're commenting on his start date? It's BEFORE yours, is it not?"

By ONE day.
Oh come on.
But I've been using DB since Janurary so...

the rabi

demons breath
16
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 17th Oct 2007 01:44
I was using mine since the christmas before I joined, how do you know that Aluseus GOD wasn't using it for several years before he joined? And the fact that it's one day doesn't deny the fact that it voids all of your right to insult his start date. You shouldn't mock a man's start date anyway. People can get very insecure about these things.

http://jamesmason01.googlepages.com/index.htm
Insert Name Here
12
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 17th Oct 2007 20:40
I'm not mocking it...
Sniff...

the rabi

Libervurto
13
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Oct 2007 20:06
I am the only person to join on my date
If you can find anyone else bring him to me and we will fight to the death... with posts... of the message type... a fight to the slap!

Ha I was thinking "man I can't be bothered to go through that code" but I already have! hehe
Pretty good that, if I say so myself
I might compile all of my ramblings into a tutorial some day

Login to post a reply

Server time is: 2019-12-08 04:59:25
Your offset time is: 2019-12-08 04:59:25