|
|
|
|
|
|
|
|
SGT_FW
by Aku_Aku. 05/31/26 11:05
|
|
|
|
|
XTB
by pr0logic. 05/18/26 12:27
|
|
|
1 registered members (AndrewAMD),
2,372
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Aum 104
[Re: Kartoffel]
#392927
01/29/12 18:13
01/29/12 18:13
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
not just every semicolon. or is
for(x;y;z;)
equal to 3 lines o.o
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Aum 104
[Re: Rackscha]
#392929
01/29/12 18:37
01/29/12 18:37
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
If you rewrite it to: x = 0; while( (x += z) < y ) { ... } It's one  . @Kartoffel: I think people made such code also with the previous 200 lines contest, if you don't want to write yourself  .
Last edited by Joozey; 01/29/12 18:42.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Aum 104
[Re: Joozey]
#392934
01/29/12 19:07
01/29/12 19:07
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
@Joozey Yes I think so, too. ...but I made one for practise  If someone needs it: It counts every semicolon in the file 'search_this_file.c' but ignores semicolons in strings (f.e. str_cpy(temp,"asdf;"); )
#include <acknex.h>
TEXT* txt = {strings = 10000;}
var count = 0;
function main()
{
fps_max = 60;
int i;
int disable_count = 0;
int lines = txt_load(txt,"search_this_file.c");
wait(1);
i=0;
while(i<lines)
{
while(str_len((txt.pstring)[i]) > 0)
{
if(str_cmpni((txt.pstring)[i],"\""))
disable_count = 1 - disable_count;
if(str_cmpni((txt.pstring)[i],";") && disable_count != 1)
count++;
str_clip((txt.pstring)[i],1);
}
wait(1);
i++;
}
}
PANEL*abc={flags=SHOW;digits(9,9,"Number of semicolons: %.f",*,1,count);}
EDIT: the 2nd wait(1); can be deleted... should be much faster then.
Last edited by Kartoffel; 01/29/12 19:36.
POTATO-MAN saves the day! - Random
|
|
|
Re: Aum 104
[Re: Kartoffel]
#392936
01/29/12 19:18
01/29/12 19:18
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
That's very nice Kartoffel! It works well. Currently 643 semicolons in my unoptimized project  . Should be doable.
Last edited by Joozey; 01/29/12 19:18.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Aum 104
[Re: George]
#393099
01/31/12 16:17
01/31/12 16:17
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
How much lines does the following command count?
pan_create( "bmap=someBitmap; pos_x=100; pos_y=100; flags = SHOW;", 2 );
Also is this allowed? if( a = 20 ){}
Last edited by Joozey; 01/31/12 23:15.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Aum 104
[Re: HeelX]
#393225
02/01/12 16:16
02/01/12 16:16
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Then I'm out  or I'll write everything in one line Yes but theres still the 5KB limit. The code that I want to use for the contest has now 2 lines without #include <acknex.h> but it's already 3.5kb big (and I have got the problem that it crashes sometimes... but I don't know why :/)
POTATO-MAN saves the day! - Random
|
|
|
|