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 / What is a command?

Author
Message
fasdfsdaf
19
Years of Service
User Offline
Joined: 17th Jan 2005
Location:
Posted: 29th Mar 2005 17:21
I was just wondering what is considered a command. Is:

if a = 1 or b = 2

two commands? or just one? Is a command anything that is between two ":"'s?

www.war3forums.net

A.K.A Death Stalker
Atreides
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location: Switzerland (but NOT on a mountain !)
Posted: 29th Mar 2005 18:54
hmm.. I think there is only one command : a condition... But I'm far not sure of it.
another similar question would be how many commands are there in "rgb(rnd(255), rnd(255), rnd(255))". I usually count is as four commands, but who knows ?

The sleeper must awaken !
fasdfsdaf
19
Years of Service
User Offline
Joined: 17th Jan 2005
Location:
Posted: 30th Mar 2005 13:03
How many commands would this be considered?:



www.war3forums.net

A.K.A Death Stalker
Foxy
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: The Dale, South Australia
Posted: 30th Mar 2005 16:06
I'd say four. I see a command as a word or combination that makes the computer do or check something.

Gaming resources.

fasdfsdaf
19
Years of Service
User Offline
Joined: 17th Jan 2005
Location:
Posted: 31st Mar 2005 08:43
so,you could have 10,000 endif's in a 20 liner, and 25 "actions" and it would be legal?

See, I'm trying to make a program for this compotition, but I don't know what should be put on a single line.

www.war3forums.net

A.K.A Death Stalker
Foxy
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: The Dale, South Australia
Posted: 31st Mar 2005 09:28
With the 20 liner a line is a line with code on it, any code. The best thing you can do is stack anything and everything possible, like all you startup stuff; sync on:hide mouse:sync rate 30 or whatever.

Gaming resources.

Robot
19
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 1st Apr 2005 00:29
I would be impressed if you managed to fit 10000 endifs in twenty lines along with the rest of your code

The happenings of tommorow are behind us now
Kohaku
19
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 1st Apr 2005 15:15
I wonder if we can get the commands that return a value excluded from the command limit. So commands like rgb(), rnd() or timer will be ignored in the count.

I mean, look at the box command. Every time I use it, I use four rgb commands, and sometimes screen width() and screen height() too. That's alot of commands for one gradient box!

You are not alone.
Jess T
Retired Moderator
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 1st Apr 2005 16:39
Aura! Have you learnt nothing!

You need to code wize, my young padwan.

Things such as declaring a variable equal to Screen width() ensures you only use it once, and use Ink instead of four RGB commands!

Think about it... that's what the challenge is all about!

'roo.

If the apocalypse comes, email me
Kohaku
19
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 1st Apr 2005 16:55
It's degrading for boxes to use so few a command between their brackets. They have rights too you know.

Rights for boxes!

You are not alone.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 1st Apr 2005 19:57 Edited at: 1st Apr 2005 20:05
Interestingly when we were young, we were taught that there are differences between commands, (internal) functions, and statements (well, and directives). So from that background, the line

would contain 1 command, namely "sleep". "If/Endif" would be a statement block, "end" a statement, "object exist()" and "keystate()" would be internal functions.

Apperantly these days it's all a bit blurred.


Edit: got it a bit mixed up. Well it's early.


Play Nice! Play Basic! Version 1.06
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 22nd Apr 2005 16:10
i count it as one complete code statement.
any thing that can't be on the same line as something
else unless there is a ':' between it, because the compiler
would give an error.

if x=1 inc x endif
simply wouldn't work.
if x=1
inc x
endif
or
if x=1:inc x:endif
both work, and both count as 3 commands.

bob

check out some of my wicked 20-liners

Login to post a reply

Server time is: 2024-04-20 12:28:29
Your offset time is: 2024-04-20 12:28:29