• Facepunch Code Golf Competition
    111 replies, posted
[QUOTE=yakahughes;26755859][lua]AssignFile(f,'golf.txt');Reset(f);Read(f,a,b,c);Writeln(Format('%d %d', [a*b,c-a*b]));Close(f);[/lua] 95 bytes in delphi.[/QUOTE] That won't work properly if there are enough seats, it will write a negative number.
Oops.
is that the full source code? didnt i remember delphi to need program, begin and end and all that stuff?
In case anyone beats my last 84 byte entry before tomorrow, a questionable 79 byte version: (bash) [code]set `cat *n.*`;z=$3;e=0;((z>(x=$1*$2)))&&let e=z-$x,z=$x;echo $z $e>sitout.txt[/code] [editline]1[/editline] Make that 77 bytes :3: [code]set `cat *n.*`;z=$3;e=0;((z>(x=$1*$2)))&&let e=z-x,z=x;echo $z $e>sitout.txt[/code]
[QUOTE=TomyLobo;26762932]is that the full source code? didnt i remember delphi to need program, begin and end and all that stuff?[/QUOTE] [quote=Azuisleet]Hush[/quote]
[release] [b]Results going from smallest to largest entry until I find a correct solution:[/b] [quote] Darkimmortal's 77/79 byte bash entry: [code]set `cat *n.*`;z=$3;e=0;((z>(x=$1*$2)))&&let e=z-x,z=x;echo $z $e>sitout.txt[/code] [highlight]Incorrect[/highlight] - failed on the sample data, outputting '0 12'. [/quote] [quote] Darkimmortal's 84 byte bash entry: [code]set `cat sitin.txt`;z=$3;e=0;((z>(x=$1*$2)))&&let e=z-$x,z=$x;echo $z $e>sitout.txt[/code] [img]http://static.facepunch.com/fp/ratings/winner.png[/img] [img]http://static.facepunch.com/fp/ratings/winner.png[/img] [b]Winner[/b] [img]http://static.facepunch.com/fp/ratings/winner.png[/img] [img]http://static.facepunch.com/fp/ratings/winner.png[/img] - passed all test data. Darkimmortal, your prize has been PMed to you. [/quote] [/release] As the winner of the competition, Darkimmortal can hold the next one if he wishes, otherwise someone else can. Congratulations to all who participated and good luck for the next code golf competition!
[QUOTE=Siemens;26773736][release] [b]Results going from smallest to largest entry until I find a correct solution:[/b] [/release] As the winner of the competition, Darkimmortal can hold the next one if he wishes, otherwise someone else can. Congratulations to all who participated and good luck for the next code golf competition![/QUOTE] Hey, I had the shortest! Why is it called code golf?
cause you try to use the fewest amount of hits (bytes) to hit the hole ... says wiki
Darkimmortal, next one please.
[QUOTE=yakahughes;26784772]Darkimmortal, next one please.[/QUOTE] Trying to think of something interesting :P
How about a rule to prevent the use of languages or custom interpreters/compilers made specifically for golfing? I can think of a few examples, like goruby or GolfScript...
[QUOTE=raBBish;26784990]How about a rule to prevent the use of languages or custom interpreters/compilers made specifically for golfing? I can think of a few examples, like goruby or GolfScript...[/QUOTE] Agreed, I'll include that as a rule.
[QUOTE=Darkimmortal;26785046]Agreed, I'll include that as a rule.[/QUOTE] What? How can you do such a thing to me? You... you... bastard! On a more serious note, I like to point out that that I was beaten both by bash and by Lua 4.
[QUOTE=itsbth;26785157]What? How can you do such a thing to me? You... you... bastard! On a more serious note, I like to point out that that I was beaten both by bash and by Lua 4.[/QUOTE] Yeah but this next challenge will be a bit longer so you would have an unfair advantage
[QUOTE=Darkimmortal;26785274]Yeah but this next challenge will be a bit longer so you would have an unfair advantage[/QUOTE] Unfair advantage? Might as well say that everyone should use a certain language then. There's always some languages that are better than others for a specific task.
[QUOTE=Darkimmortal;26785274]Yeah but this next challenge will be a bit longer so you would have an unfair advantage[/QUOTE] I have an idea: [release] [B]Create a simple programming language![/B] Create a programming language in your favorite language. The one with the most points wins. Points are as follows: [B]Bytes[/B] - The amount of bytes in your program divided by 3 is subtracted from your total score. That means that lower bytes makes for higher score! [B]Features[/B] - See below for mandatory commands. Extra commands are an extra 10 points per. [B]User Friendliness[/B] - Max 20 points. Do you have a list of commands? Tutorials? How easy is it to learn the language? [B]Follows rules[/B] - If you follow all the rules (below), you get 50 points. If not, you get 0. [B](Extra) Esoteric[/B] - If your language is esoteric, you get 10 points! [B](Extra) Web[/B] - If your language has a parser on the web (aka PHP, ASP, CGI, JS), you get 10 points! [B](Extra)No Extra Libraries[/B] If you don't use any extra libraries, you get 50 points! [highlight] RULES [/highlight] The rules are: [LIST] [*]Must have commands: [LIST] [*]Print [*]Variables [*]if statements [*]functions [*]while loops [/LIST] [*]Must use publicly available libraries + compilers. [*]Can't use compilers/libraries made just for this (no loopholes) [*]Must be in a zip file [*]Deadline: 8th Jan 2011 [/LIST] Have Fun! [/release]
[code]a=io.open;j="*n";b=a"a";c=a("b","w");d,e,f=b:read(j,j,j);z=math.max(f-e*d,0);c:write(f-z," ",z)[/code]95 bytes Lua 5, super late but whatevs [editline]18th December 2010[/editline] [code]a=io.open;j="*n";d,e,f=a"a":read(j,j,j);z=math.max(f-e*d,0);c=a("b","w");c:write(f-z," ",z)[/code] 91 bytes. Woo, stole one of rabbish's optimizations for size.
[QUOTE=supersnail11;26786126]I have an idea: [release] [B]Bytes- The amount of bytes in your program divided by 3 is subtracted from your total score. That means that lower bytes makes for higher score![/B] The rules are: Must have commands: [LIST] [*]Print [*]Variables [*]if statements [*]functions [*]while loops [/LIST] [/release][/QUOTE] I'd be very surprised if anybody got a score above 0. Seems like a bit of a large project for a Code Golf Competition doesn't it? I could be wrong of course..
The next competition: [url]http://www.facepunch.com/threads/1039458-Facepunch-Code-Golf-Competition-2[/url]
[QUOTE=Dotmister;26787436]I'd be very surprised if anybody got a score above 0. Seems like a bit of a large project for a Code Golf Competition doesn't it? I could be wrong of course..[/QUOTE] Fine....divided by 20.
[QUOTE=supersnail11;26786126]I have an idea: [release] [B]Create a simple programming language![/B] Create a programming language in your favorite language. The one with the most points wins. Points are as follows: [B]Bytes[/B] - The amount of bytes in your program divided by 3 is subtracted from your total score. That means that lower bytes makes for higher score! [B]Features[/B] - See below for mandatory commands. Extra commands are an extra 10 points per. [B]User Friendliness[/B] - Max 20 points. Do you have a list of commands? Tutorials? How easy is it to learn the language? [B]Follows rules[/B] - If you follow all the rules (below), you get 50 points. If not, you get 0. [B](Extra) Esoteric[/B] - If your language is esoteric, you get 10 points! [B](Extra) Web[/B] - If your language has a parser on the web (aka PHP, ASP, CGI, JS), you get 10 points! [B](Extra)No Extra Libraries[/B] If you don't use any extra libraries, you get 50 points! [highlight] RULES [/highlight] The rules are: [LIST] [*]Must have commands: [LIST] [*]Print [*]Variables [*]if statements [*]functions [*]while loops [/LIST] [*]Must use publicly available libraries + compilers. [*]Can't use compilers/libraries made just for this (no loopholes) [*]Must be in a zip file [*]Deadline: 8th Jan 2011 [/LIST] Have Fun! [/release][/QUOTE] You can make a competition when you win a competition
Sorry, you need to Log In to post a reply to this thread.