Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Pure Allegro Competition returns after 2 years.

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Pure Allegro Competition returns after 2 years.
Siloh
Member #2,786
October 2002

[URL removed]

It has begun.

spellcaster
Member #1,493
September 2001
avatar

Quote:

1) Everything must exist in your main function.
[...]
5) Your program must be contained within a single file.
6) You may not write your own functions.
7) You may not use the preprocessor.

You realize that 1) implies 5), 6) and 7)?
You also realize that with the preprocesso one cannot include allegro.h? Or the allegro provided macros including END_OF_MAIN()?

You cannot use timers.
You cannout use any callback functions.

Besides that nitpicking, what's the idea behind it?

--
There are no stupid questions, but there are a lot of inquisitive idiots.

23yrold3yrold
Member #1,134
March 2001
avatar

Yay, yet another comp :P

And yes, those rules (especially regarding the preprocessor) seem a bit odd ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Siloh
Member #2,786
October 2002

The rules have been clarified a bit.

Quote:

You cannot use timers.
You cannout use any callback functions.

Find another way to do it, that's the idea. :)

spellcaster
Member #1,493
September 2001
avatar

Why don't you add a requirement like "you may not use any functions containing the letter 'n'"?

In other words, what you want us to do is to code in the worst style possible, right?

Anyway... you can still use Macros without any problems. All you need to do is to call the preprocesser explicitely, and then submit the output of the preprocessor run.

And by using c++ you can circumvent that anyway, since you are allowed to define types (including classes which can include methods) outside of main().

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

rule: You may not write your own functions. (methods be functions)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

methods are no functions. That's why they are called methods.

Anyway... by using some global vars you can fake function calls anyway. It's just more effort. What you'd need to do is to make all your functions part of a giant switch.
Then use a big array to store the call stack.

Would work well, but is pretty pointless to do. It's also no real fun. The "code a game in 23 lines" was more fun and more hackish :)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

I agree. the 20 line game thread did rock.

But yeah, a big switch would work, and apparently it got done the first time arround, someone made a VM in thier main loop to do all the tricky stuff...

oh, method == fancy function. same thing. they just get some extra context.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Evert
Member #794
November 2000
avatar

Which reminds me, I had an archive of all the Allegro 20 liners posted in that thread. I'll see if I can dig it up and post it, some of those games were nice.

Hmm... maybe it'd be fun to do something like that again?

Fladimir da Gorf
Member #1,565
October 2001
avatar

Maybe a 20 line demo compo or something?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Thomas Fjellstrom
Member #476
June 2000
avatar

Or how bout the scarriest C code you've ever seen compo?

I have some scarry code, that isnt working how I thought it should.. but then, thats the nature of scarry code.

1#include <stdio.h>
2#include <setjmp.h>
3 
4jmp_buf main_buf, func_buf;
5int thrown = 0, reset = 0;
6int released = 0;
7 
8#define say(a,b...) ({ \
9 char *buf__ = NULL; \
10 asprintf(&buf__, a, #b); \
11 printf("%s:%s:%i :: %s\n", __FILE__, __FUNCTION__, __LINE__, buf__); \
12})
13 
14#define throw() RESET: ({ int ret = setjmp(func_buf); if(ret==2 && !reset) { reset = 1; goto RESET; } \
15else if(!reset) { thrown = 1; longjmp(main_buf, 2); } else { reset = 0; } })
16#define catch else
17#define try DOME: ((setjmp(main_buf) == 2) ? ({ goto DOME; }) : (void)0 ); if(!thrown)
18#define release() thrown = 0; longjmp(func_buf, 2)
19 
20int func(int fail)
21{
22 say("Yatta!");
23 if(fail) {
24 say("throwin...");
25 throw();
26 }
27 say("Done!");
28
29 return 1;
30}
31 
32int main()
33{
34 say("Do IT!");
35
36 try {
37 say("func() 1");
38 func(0);
39 say("after func 1");
40 say("func() 2");
41 func(1);
42 say("after func 2");
43 say("func() 3");
44 func(2);
45 say("after func 3");
46 say("...");
47 } catch {
48 say("Caught!!");
49
50 if(!released) {
51 released = 1;
52 say("Releasing ;)");
53 release();
54 say("after release");
55 }
56
57 say("Keeping...");
58 }
59
60 say("all done.");
61 return 0;
62}

;D

Yes people, this is C. It WILL NOT compile as C++ code.. or if it does, you're damn lucky.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Siloh
Member #2,786
October 2002

Please don't post if you aren't going to participate, sorry but I don't like coming here and reading a bunch of crap posts about peoples' opinions.

Here is my entry... I could add alot more too it (like explosions and stuff), but I want to keep it the way it is for now.

[URL removed]

pantz
Member #3,387
March 2003

Heh your entry isn't valid, it breaks the rules ;)

spellcaster
Member #1,493
September 2001
avatar

... checking ...
:)
Quite funny indeed. Some serious macro action going on :)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

I do belive he meant no #define ing on your part...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

He said no macros besides "END_OF_MAIN".
So, no MIN, MAX, SCREEN_W, SCREEN_H, LOCK_XXX(), TRUE, FALSE, KEY_XXX, etc.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

X-G
Member #856
December 2000
avatar

How does that "random" thing work? I can't see any randomization anywhere ...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

DanielH
Member #934
January 2001
avatar

Give up now and change the rules. ::)

And where did you come from? You dare bitch about us posting crap. You've only have three posts total. All in this thread.

Thomas Fjellstrom
Member #476
June 2000
avatar

Hes a regular in #allegro...

Quote:

How does that "random" thing work? I can't see any randomization anywhere ...

using what was in a certian memory position last... thats likely to be fairly random.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

It's just as likely to be all zeroes. :P

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

It's just as likely to be all zeroes.

Yup. Just as an infinite amount of monkies taping an infinite amount of keys on an infinite number of typwriters can produce all of Shakespeare's plays.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

It's not random - it's just undetermined. :P

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Niunio
Member #1,975
March 2002
avatar

I think this compo is a good idea. It remembers me the old good times I program in GW-BASIC...:)

The random isn't hard to get, just with some maths that includes divisions of odd numbers, mods, rounds and all that...

May be I'll try, if I have a good idea this weekend;)

A question: #define M_PI 3.141569... is a macro/preprocessor directive?

-----------------
Current projects: Allegro.pas | MinGRo

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

It's not random - it's just undetermined.

Then, what is random?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

One feature of the randomosity required here would be fairly even distribution - something that reusing old memory definitely will NOT have. :P

Quote:

A question: #define M_PI 3.141569... is a macro/preprocessor directive?

Yes. So is END_OF_MAIN, SCREEN_W, SCREEN_H, MIN, MAX, GFX_AUTODETECT, etc ...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

 1   2   3 


Go to: