Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,135 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 12 of 22 1 2 10 11 12 13 14 21 22
Re: 100 lines contest [Re: ] #208009
05/24/08 04:03
05/24/08 04:03
Joined: Feb 2007
Posts: 353
A
amy Offline
Senior Member
amy  Offline
Senior Member
A

Joined: Feb 2007
Posts: 353
- reusability of templates
- best readable code

I would say all of your points except those two since using the templates won´t be allowed (only stuff in the "include" and "code" folder I think!) and it would be a bit silly to expect very readable code from a contest like this. smile

Re: 100 lines contest [Re: amy] #208014
05/24/08 05:28
05/24/08 05:28
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
I guess that the winner will be the most impressive project, the one that shows the power of lite-C, its ability to create games or other applications with only a few lines of code. You can include the template scripts if you want to, but I believe that the jury won't be too impressed if you don't add your own code as well.

Re: 100 lines contest [Re: George] #208063
05/24/08 14:20
05/24/08 14:20
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I'm too busy to join the contest, so here's a nice trick I thought of to avoid semicolons (I don't think it was mentioned before):

a = 3;
-> while(!(a = 3)) {} // same effect, no semicolons
Make sure that you negate (!) when the value you are assigning is non-zero.

It works for any kind of expression, even function calls with a return value:
str_cpy(a, b);
-> while(!str_cpy(a,b)) {}

Another one, should be well known:
int a;
int b;
int* c;
-> int a, b, *c; // 1 semicolon instead of 3

Now you can write code using nearly no semicolons smile

Re: 100 lines contest [Re: Excessus] #208066
05/24/08 14:27
05/24/08 14:27
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
...you spoiled everything! smile i figured out some more tricks like that. one is cleaner to read, doesn't have the ! problem and consumes less space. it was clear pretty soon that this actually only is a 10kb contest.

an entry with 0 semicolons would be 1337. :p but i think variable declarations aren't possible without?

Re: 100 lines contest [Re: ventilator] #208075
05/24/08 15:34
05/24/08 15:34
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
#define myvar 0
?


Click and join the 3dgs irc community!
Room: #3dgs
Re: 100 lines contest [Re: Joozey] #208080
05/24/08 16:05
05/24/08 16:05
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Preprocessor statements like this work only globally. Defines are nice, though, this way I get additional 15 characters in my sourcefile instead of just using 0 wink

Re: 100 lines contest [Re: HeelX] #208393
05/27/08 08:03
05/27/08 08:03
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
Code:
#define DO(statement) if (1 || (statement)) {}

void myfunc(var i, var j, char *c, STRING* str, PANEL* p)
{
    DO(i=3)
    DO(str = str_create())
    //...
}


so no semicolons needed any more...

Re: 100 lines contest [Re: Joey] #208397
05/27/08 08:30
05/27/08 08:30
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i simply replaced many of my semicolons with +.

i=
(a=3)+
(str = str_create())+
...
(vec_inverse(v));

smile

Re: 100 lines contest [Re: ventilator] #208451
05/27/08 14:23
05/27/08 14:23
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
As Vent predicted, this becomes really a 10kb sourcefile size contest wink I'm around 50 lines now (there are things you cant workaround with tricky hacks) and my file is around 7KB, still growing. I think the real hacking begins when I come close the 10kb border with trying to reduce ASCII characters wink

Re: 100 lines contest [Re: HeelX] #208454
05/27/08 14:54
05/27/08 14:54
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
plenty of ; hacks. now go on to 10kb hacks.

#define _ var
#define _s STRING*

saves you some chars.

Last edited by Quadraxas; 05/27/08 14:54.

3333333333
Page 12 of 22 1 2 10 11 12 13 14 21 22

Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1