|
An Allegro Game in 20 lines of code - Possible? |
Thomas Fjellstrom
Member #476
June 2000
|
I was working on atwo player pong last night too bad I was too tired to finish But its at like 22 lines (pretty much finished, just need to fix a bug...) -- |
23yrold3yrold
Member #1,134
March 2001
|
Restricting to lines and columns might work if you discount headers, since #includes need their own lines, right? I like the character count idea better ... and Spellcaster's source code gives me a headache. Crafty use of ?: though -- |
Thomas Fjellstrom
Member #476
June 2000
|
You should see mine... Lots of &&, || and () edit: well, It USED to have lots of &&, || and ()... But writing code on 2 hours (in 48) of sleep is a bad idea. -- |
nonnus29
Member #2,606
August 2002
|
Nice work SC and BP; see if I can get mine done tonight... it won't be 20 lines though; maybe 30 |
Thomas Fjellstrom
Member #476
June 2000
|
well.. Heres my entry
It doesn't make the requirements (and is a bit buggy...). But I like it [edit]new version (w00t. It still doesn't quite make it nonnus) oops.. that should be 20... [edit2] hmmmm.. I can shorten those 3 vlines to a for and 1 vline... sould I -- |
nonnus29
Member #2,606
August 2002
|
EDIT: Here's my shooter; its 22 lines though, very light on the comma's (only one line uses comma's, the allegor line) No collision detection, but you can shoot your little gun
Nice pong TF; cheat on the comma's (like everyone else) in your allegro init code and you can get it under 20 |
yoheeb
Member #917
January 2001
|
can anyone say FORTRAN? Ahhh, Flashback, Flashback.....columns 1-9 ahhhh.... Jay Measure with a micrometer, mark it with chalk and cut it with an axe. |
Thomas Fjellstrom
Member #476
June 2000
|
COMEON PEOPLE!!! We Wanna see more! You know you want to! -- |
Karadoc ~~
Member #2,749
September 2002
|
--- Edit ---
----------- |
Matthew Leverton
Supreme Loser
January 1999
|
Well, my game is 19 lines long right now, if I tallied correctly. I've only a bit more left before it's playable. Unfortunately, it's bed time. And I'll be lucky if I can remember how it works tomorrow though. The name of the game is "20 Lines", and it's a dandy. |
Thomas Fjellstrom
Member #476
June 2000
|
If I can think of something more original than Pong.. I'll post it Ohhh.. maybe Plinko -- |
miran
Member #2,407
June 2002
|
Here's my 20 lines:
Keep the ball in the air for as long as you can... EDIT: fixed a little bug... -- |
Thomas Fjellstrom
Member #476
June 2000
|
heh. The flash version is fun too... though I bet its more lines of code! -- |
Plucky
Member #1,346
May 2001
|
Here's my first attempt:
The code has the following features: |
miran
Member #2,407
June 2002
|
There is no newline at the end of file! EDIT: -- |
Thomas Fjellstrom
Member #476
June 2000
|
heh. Mine's only got one warning with -W and -Wall on line 4 -- |
Bruce Perry
Member #270
April 2000
|
Now try using -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wno-system-headers. (Also try without -Wno-system-headers if you're a masochist.) -- |
Thomas Fjellstrom
Member #476
June 2000
|
ooohhhh... and 1 more on line 3... ouch. that hurt. edit: Quit editing while I'm posting. Its getting anoying edit2: Quote: tf.c:3: warning: no previous declaration for `_mangled_main' still ouch. and I can't do a bloody thing about _mangled_main. edit3: Also tried removing -Wno-system-headers. Nothing changed. -- |
Plucky
Member #1,346
May 2001
|
Quote: EDIT: Good thing I said "hopefully"! Actually when I compile with MinGW 2.0, I get no warnings under -Wall, and a warning on line 5 with -W. |
Bruce Perry
Member #270
April 2000
|
int main(void); int main(void) { ... I found -Wno-system-headers was necessary, because one of the earlier flags made it warn for lots of stuff in allegro.h. I suppose it depends on the GCC version. As for line 5, I always use { }. Personally I don't think they should have removed that warning - you might have written the following by accident: while (...); { ... }
-- |
FrankyR
Member #243
April 2000
|
Miran: Awesome game. That should ship with every copy of windows!
Just catch as many balls as you can. |
nonnus29
Member #2,606
August 2002
|
Miran - that is a really cool game; good idea! |
Thomas Fjellstrom
Member #476
June 2000
|
Quote: As for line 5, I always use { }. Who is that directed at? -- |
nonnus29
Member #2,606
August 2002
|
Quote: Who is that directed at? ROFLMAO Now that really made me laugh. Now if it were line 25 we could narrow it down a little, but line 5 in this thread? No chance. |
Thomas Fjellstrom
Member #476
June 2000
|
ja.. IIRC I have a while on line 5, but I also have brakets sooo... And whats weird, is Ben seems to think that all those extra -W's will change the messages i get... but neither 2.95.4 or 3.2 makes a difference sooo. heh. What's weirder, is that if I set a DGA mode in X, my player two score starts off with 1, but If I set a Xwindow full screen mode, player 2's score starts off at 0... Pain in the royal A$$. -- |
|
|