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 / Circle Game

Author
Message
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 23rd Sep 2009 02:27
The idea for this game was not mine, I saw it somewhere on this forum. It was attached as an exe on someones post and so I decided to try and replicate it and post it as a 20 liner. Here it is:


This was done in DBPro and truth be told its actually 32 lines. If anyone can suggest a way to compress it more that would be great!
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 23rd Sep 2009 23:38
Between the statements you can put a colon,

this thread will be locked i imagine if its over 20 lines

Omricon W.I.P
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 24th Sep 2009 00:46
between the if, then statements? I thought that you couldn't???
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 24th Sep 2009 05:55
I optimised my code and now its only 16 lines!!!!!!!!!!!!!!
Here it is:
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 26th Sep 2009 11:17
I optimized your code and now it's only three lines.



I think it's hardly a twenty-line challenge anymore.
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 26th Sep 2009 16:25
lol nice
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 26th Sep 2009 16:28
just reviewed your code and you had some weird formulas in there
Madscientist
14
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 26th Sep 2009 17:15 Edited at: 26th Sep 2009 17:18
I made the original. Good, I see that it has been changed to be so short. Nice! The only thing is that it is to hard. Lower the circle's speeds in general because easy isn't to easy.

If it hasn't exploded yet, I haven't touched it.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 26th Sep 2009 22:26
Quote: "just reviewed your code and you had some weird formulas in there"


Haha, yeah, well the order of the circle colors was weird so I had to scratch my head for a while coming up with a way to map all of them in one go. Modulus division is a useful thing.

I tried to make it work exactly like fearred's original code, and an interesting thing I noticed was, even though you set the sync rate to 60 at the beginning, you never call sync on. I don't know why it works this way, but it pretty effectively cut the framerate to 30. So, in my version I used sync on, but set the sync rate at 30. Maybe it's just my hardware that does this. I don't know.
fearred
14
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 27th Sep 2009 02:31
Since I didn't understand half of Kira Vakaan's code I decided to shorten it myself, again. So I fixed the sync on and set the sync rate to 30 which didn't actually change the game but made more sense.... Then I just did some overall optimising and followed Madscientist's suggestion and made the game easier. The difficulty level was originally 1 to 5 but I changed it to 1 to 10.

* For some reason its not letting me put in the new code as when I paste it in it just expands it to like 10 lines? Anyways just so you know I managed to get it down to 3 lines without using your weird formulas.

Login to post a reply

Server time is: 2024-04-19 00:27:16
Your offset time is: 2024-04-19 00:27:16