17
\$\begingroup\$

The accepted winner is isaacg, with his 7-bit ASCII answer. However, the challenge isn't over yet - this bounty is awarded to the shortest answer. If, somehow, you get all the first characters of all the other answers down into 10 bytes, you will win the bounty. This includes all the characters from Round 2's GolfScript answer (plus the one added by that answer itself). This is the ONE time I will let you go out of order - if you have any objections to this, let me know in the comments.

I'd like to give credit to randomra, who helped me with my old idea and gave me this new one.

Previous Winners

  • Round 1: isaacg, with 7-bit ASCII
    Next bytes: 30 (or 10 if you want that sweet, sweet rep)
    You know, code-golfing is really cool. People take a challenge, and it slowly gets smaller! But let's do this another way. So, here is my challenge:

  • The code will print the first character of all the previous answers in the order they were posted (the first answer prints nothing)

  • The code starts at 100 bytes and decreases by 5 each time.
  • If two posts are going by the same answer (i.e, they both posted within a few seconds of each other), the newer one has to add the old one's character and decrease by 5 bytes (even by a few seconds).
  • Any language can be used.
  • Your code must not produce any errors.
  • Your code must use all the bytes required for the first step.
  • Your code must print to STDOUT.
  • Non-printable characters are OK, but:
    • They can not be the first character (for the sake of the purpose of this question)
    • You must let everyone know where they are
  • You may post multiple answers, but:
    • You must wait 2 answers before posting another (so if you posted the 100 bytes, you have to wait until 85 bytes.)
  • You can't:
    • use more than 10 bytes of comments
    • have variables that go unused for the entire program
    • fill the program with whitespace
    • have variable names longer than 10 bytes (but you can have multiple less-than 10-byte variables)
      (EMBLEM's first answer being the exception to these rules, because it was posted before these restrictions.)
  • No standard loopholes. Unless you want to take all the fun out of the challenge.
  • When no more answers are submitted for 3 weeks, the answer that uses the fewest bytes wins. (In the event of a tie, the one printing the longer string wins.)

Example: The third answer has to be a 90 bytes long code outputting two characters (the first char of the 100-byte code then the first char of the 95-byte code). The first answer outputs nothing (no previous answers to get chars from).

\$\endgroup\$
  • \$\begingroup\$ "Unnecessary whitespace" is bad wording. Python's whitespace to end statements is unnecessary, because you can use semicolons. \$\endgroup\$ – EMBLEM Apr 7 '15 at 18:17
  • 8
    \$\begingroup\$ Perhaps, we can start at 100 bytes again, but start with ppuppPq([#fwSmdP[ as the starting string, and restarting each time the string is longer than the allowed bytecount. I can't think of a winning criterion then, though. \$\endgroup\$ – Sanchises Apr 7 '15 at 20:22
  • 1
    \$\begingroup\$ @Scimonster You honestly think there is a 4-bit character set that includes all of #(PS[dfmpquw? We're running into the very limits of information density here. Unless you write a 10-byte program that processes all previous answers. Not sure if that's worth waiting for. \$\endgroup\$ – Sanchises Apr 7 '15 at 21:30
  • 2
    \$\begingroup\$ @sanchises We're not saying there is one. We're giving people a chance to see what they can do. If no one can, we'll restart it. \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 21:35
  • 6
    \$\begingroup\$ -1 Why didn't this challenge just die with dignity after the 15-byte solution? It seems disingenuous to change it after a good, "winning" answer has been given just so you can keep playing by different rules. \$\endgroup\$ – Geobits Apr 9 '15 at 13:07

32 Answers 32

34
+150
\$\begingroup\$

7-bit ASCII, 15 bytes

Updated: I did not realize that padding should occur at the end.

Correct version, padded at end:

hexdump (xxd):

0000000: e1c3 af0e 1438 a8b6 8f37 7a7b 7250 b6    .....8...7z{rP.

Printouts (not sure which is correct):

�ï8��z{rP�

áï8¨¶7z{rP¶

Old version, incorrectly padded at the front:

pá×
T[G½=¹([

The language / format here is 7-bit ascii, where each group of 7 bits corresponds to an ASCII character. It is used in transferring SMS data. A decoder is located here.

No widely accepted ruling exists on whether answers to fixed output questions which are not written in a programming language are allowed. See this meta post for more information. (I apologize, I misread that post earlier.)

\$\endgroup\$
  • 2
    \$\begingroup\$ Congratulations! You are the only person I've seen to compress a string longer than the code it's included in! :D \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 21:08
  • \$\begingroup\$ @ASCIIThenANSI Compressing a string into a shorter program is easy. The Python program print('A'*100) prints a string of 100 A's. Compressing an effectively random string is not easy. \$\endgroup\$ – Calvin's Hobbies Apr 8 '15 at 0:26
  • 6
    \$\begingroup\$ @Calvin'sHobbies This would be easier if we had all just started all our code with the letter 'p'. :D \$\endgroup\$ – ASCIIThenANSI Apr 8 '15 at 1:25
  • 4
    \$\begingroup\$ -1 I should've looked at this sooner... This appears to be encoded incorrectly. It looks like you start with a bit of padding, but from what I can tell from the format (and this answer is already stretching the definition of a format, since packed 7-bit ASCII isn't actually used anywhere), the data should be padded at the end, not the start. And even with the padding, I think the rest isn't encoded correctly. \$\endgroup\$ – Runer112 Apr 9 '15 at 13:36
  • 1
    \$\begingroup\$ It should be "áï<SO><DC4>8¨¶7z{rP¶". \$\endgroup\$ – LegionMammal978 Apr 12 '15 at 15:08
25
\$\begingroup\$

Element, 80 bytes

programs do many fun things, like print the letters p`, p`, u`, and p` in a row.

This is a language I created over three years ago. You can find an interpreter, written in Perl, here. The ` operator prints the top thing on the stack (the letters). The other punctuation does do stuff, like concatenation, but the results are never printed.

\$\endgroup\$
  • 1
    \$\begingroup\$ Very clever, sir. Very clever... \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 18:44
10
\$\begingroup\$

Clip, 20 bytes

[M"ppuppPq([#fwSmdP"
\$\endgroup\$
  • 6
    \$\begingroup\$ I think you are the last one standing. Unless somebody can compress ppuppPq([#fwSmdP[ in 15 bytes AND output it. \$\endgroup\$ – Sanchises Apr 7 '15 at 20:01
  • \$\begingroup\$ @sanchises If anyone does, I'd award a bounty. Because it would be just that good. \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 20:12
  • 3
    \$\begingroup\$ @sanchises If only there was some esoteric language which outputted the program with all occurrences of p replaced with pp. Then a solution would be pupPq([#fwSmdP[. \$\endgroup\$ – bcsb1001 Apr 7 '15 at 20:14
  • 1
    \$\begingroup\$ @bcsb1001 Yes, I thought of something like that recently; an esoteric language where each command is a winning challenge solution on this site, and uses the output of that command as the input for the next command. It would be awesome if somebody could program anything in that. \$\endgroup\$ – Sanchises Apr 7 '15 at 20:20
  • 1
    \$\begingroup\$ @sanchises But would that break a standard loophole rule by going out to the internet? \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 20:38
5
\$\begingroup\$

Common Lisp, 65 bytes

(print(map 'string #' code-char #(112 112 117 112 #x70 80 #x71)))
\$\endgroup\$
  • \$\begingroup\$ The last 112 should be changed to 80 (somehow). \$\endgroup\$ – LegionMammal978 Apr 7 '15 at 19:09
  • 12
    \$\begingroup\$ With this answer, an age of darkness has been ushered in. \$\endgroup\$ – PhiNotPi Apr 7 '15 at 19:49
5
\$\begingroup\$

Scratch, 45 bytes

when green flag clicked
show
say[ppuppPq([#f]

Byte count as per text representation. See meta.

\$\endgroup\$
  • \$\begingroup\$ Nice job. I never thought of using Scratch. \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 19:41
4
\$\begingroup\$

Python 3, 95 bytes

pre='public class f{public static void main(String[] a){System.out.print("");}}'
print(pre[0])
\$\endgroup\$
4
\$\begingroup\$

Haskell, 35 bytes

main = putStrLn "\&ppuppPq([#fwS\&"
\$\endgroup\$
  • \$\begingroup\$ What does "\&" do? \$\endgroup\$ – Hjulle Apr 7 '15 at 20:05
  • 4
    \$\begingroup\$ @Hjulle Take up two characters. (It's an escape code for the empty string.) \$\endgroup\$ – user19057 Apr 7 '15 at 20:06
4
\$\begingroup\$

It has been 24 hours since the edit! Let's do this! :D

Java, Round 2, 100 bytes

public class Bytes{public static void main(String[] args){System.out.print("ppuppPq([#fwSmdP[p");}}
\$\endgroup\$
  • 1
    \$\begingroup\$ How about marking this "Round 2"? \$\endgroup\$ – Claudiu Apr 9 '15 at 2:13
4
\$\begingroup\$

Round 2: Ruby, 75 bytes

"ppuppPq([#fwSmdP[ppnvos".chars.each do|character|;print character;end#4444

I thought I'd make it a little more challenging by starting my answer with a quote! >:D

\$\endgroup\$
3
\$\begingroup\$

Java, 100 bytes

public class f{public static void main(String[] a){System.out.print("");}}//createdbyEMBLEMasdfghjkl
\$\endgroup\$
3
\$\begingroup\$

Mathematica, 75 bytes

Print[StringJoin[First/@Characters/@{"publ","pre=","usin","p1 =","prog"}]];
\$\endgroup\$
3
\$\begingroup\$

F#, 60 bytes

[<EntryPoint>]let main arg=System.Console.Write "ppuppPq(";0
\$\endgroup\$
3
\$\begingroup\$

F# script, 40 bytes

System.Console.Write "\u0070puppPq([#fw"

It has its own file type (.fsx), so I'm pretty sure that it counts as a language.

\$\endgroup\$
  • 1
    \$\begingroup\$ You forgot the 'w' from Scratch. \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 19:54
  • \$\begingroup\$ I think this is also missing the 'f' from the 50 byte javascript answer. \$\endgroup\$ – user19057 Apr 7 '15 at 19:59
  • \$\begingroup\$ Fixed that, too \$\endgroup\$ – LegionMammal978 Apr 7 '15 at 20:01
3
\$\begingroup\$

Round 2: ///, 65 bytes

\p/CodeGolfIsAwesome!/puppPq/CodeGolfIsAwesome!([#fwSmdP[ppnvos"R

Thought I would spice it up a bit more with a backslash :)

\$\endgroup\$
2
\$\begingroup\$

C#, 90 bytes

using System;namespace IAmAwesome{class Program{static void Main(){Console.Write("pp");}}}
\$\endgroup\$
2
\$\begingroup\$

Ruby, 70 bytes

q = ["publ", "pre", "usi", "p1 ", "pro", "Pri"]
q.each{|s| print s[0]}
\$\endgroup\$
  • \$\begingroup\$ You'd have to rearrange it to ["publ", "pre", "usi", "p1 ", "pro", "Pri"]. \$\endgroup\$ – LegionMammal978 Apr 7 '15 at 19:06
2
\$\begingroup\$

C, 55 Bytes

#include<stdio.h>
int main(){return puts("ppuppPq([");}
\$\endgroup\$
  • \$\begingroup\$ It should be changed to "ppuppPq([". \$\endgroup\$ – LegionMammal978 Apr 7 '15 at 19:23
  • \$\begingroup\$ @LegionMammal978 Thanks, fixed. \$\endgroup\$ – user19057 Apr 7 '15 at 19:24
2
\$\begingroup\$

JavaScript, 50 bytes

function foo() {console.log("ppuppPq([#");}
foo();
\$\endgroup\$
  • \$\begingroup\$ It should be ppupPq([# \$\endgroup\$ – ASCIIThenANSI Apr 7 '15 at 19:34
  • 3
    \$\begingroup\$ @ASCIIThenANSI I don't think so. \$\endgroup\$ – Scimonster Apr 7 '15 at 19:35
2
\$\begingroup\$

MATLAB, 30 bytes

disp([112 112 'uppPq([#fwSm'])

Nicely shows how loose MATLAB goes about with data types.

\$\endgroup\$
2
\$\begingroup\$

Mathematica, 25 bytes

Print["ppuppPq([#fwSmd"];
\$\endgroup\$
  • 1
    \$\begingroup\$ I had a novel 25-byte CJam solution that encoded the string in a non-straightforward way. Unfortunately, it looks like it'll never see the light of day. :-/ \$\endgroup\$ – Runer112 Apr 7 '15 at 20:04
  • \$\begingroup\$ @Runer112 You and all your little rhymes / Still, I had this answer ~20 seconds before the 30-byte one chimed. \$\endgroup\$ – LegionMammal978 Apr 7 '15 at 20:06
2
\$\begingroup\$

Round 2: Batch, 70 bytes

REM BATCHS
GOTO B
:C
ECHO ppuppPq([#fwSmdP[ppnvos"
GOTO A
:B
GOTO C
:A

Your quote was futile. D:>

Edit: it just occurred to me that I was going by file size instead of character count, not sure how bytes are to be counted :P

Edit 2: Added a comment to fill bytes. If you check byte count on a windows machine, just pretend the "REM BATCHS" is just "REM" I guess. :P

\$\endgroup\$
  • \$\begingroup\$ I'm counting bytes with gedit; it says your answer is 63. No worries; you're close enough to fill in the gap with comments. \$\endgroup\$ – EMBLEM Apr 9 '15 at 5:34
  • 1
    \$\begingroup\$ Ah, alright cool, I'll just stick a comment in there. \$\endgroup\$ – bloo Apr 9 '15 at 5:38
  • 3
    \$\begingroup\$ @EMBLEM It's because the Windows newline is \r\n. There are 7 extra \rs there. \$\endgroup\$ – jimmy23013 Apr 9 '15 at 5:41
2
\$\begingroup\$

Round 2, Mathematica, 40 bytes

Print@"ppuppPq([#fwSmdP[ppnvos\"R\\v(c'"

Yay second page!

\$\endgroup\$
  • \$\begingroup\$ Isn't the output missing a c? \$\endgroup\$ – plannapus Apr 9 '15 at 13:45
  • 1
    \$\begingroup\$ @plannapus It was, fixed \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 13:46
2
\$\begingroup\$

Round 2, ><>, 45 bytes

4 chars of comments.

'c(v\R"sovnpp[PdmSwf#[(qPppupp'01.uwyz
ol?!;

The string now contains both " and ', so ><> answers can't just surround it with either anymore (that's how I avoided any escapes).

\$\endgroup\$
2
\$\begingroup\$

Round 2, Golfscript, 35 bytes

"ppuppPq([#fwSmdP[ppnvos\"R\\v(c'P"

No waste bytes. Starts with a quote again!

\$\endgroup\$
  • \$\begingroup\$ 7-bit ASCII won't work here, it only creates 28 bytes and includes an extra NUL \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 19:45
  • \$\begingroup\$ Someone cleverer than I will have to do it.. maybe there's some language encoded in 6 bits which can be run to produce the proper output.. \$\endgroup\$ – Claudiu Apr 9 '15 at 19:48
  • \$\begingroup\$ No, 6 bits would create 24 bytes, but we need 30. \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 20:05
  • \$\begingroup\$ @LegionMammal978: Right, 24 bytes, then 8 six-bit instructions to print them or do whatever \$\endgroup\$ – Claudiu Apr 9 '15 at 20:32
  • 1
    \$\begingroup\$ You're missing the apostrophe from 2 answers back \$\endgroup\$ – 14mRh4X0r Apr 10 '15 at 10:05
1
\$\begingroup\$

Python 3, 85 bytes

p1 = 'publ'
p2 = 'pre'
p3 = 'usi'
def cprint():
  print(p1[0], p2[0], p3[0])
cprint()
\$\endgroup\$
1
\$\begingroup\$

Round 2, C#, 95 bytes

namespace Cool{class Program{static void Main(){System.Console.Write("ppuppPq([#fwSmdP[pp");}}}
\$\endgroup\$
  • \$\begingroup\$ How about marking this "Round 2"? \$\endgroup\$ – Claudiu Apr 9 '15 at 2:13
1
\$\begingroup\$

Round 2, F# script, 55 bytes

(**)System.Console.Write(@"uppPq([#fwSmdP[ppnvos""R\v")

See my previous F# script anwer for why I think it is a valid language.

\$\endgroup\$
1
\$\begingroup\$

Round 2, R, 50 bytes

cat('ppuppPq([#fwSmdP[ppnvos\"R\\v(',file=stdout())
\$\endgroup\$
1
\$\begingroup\$

Round 2, Javascript, 60 bytes

var _p="p";alert(_p.repeat(2)+"uppPq([#fwSmdP[ppnvos\"R\\");
\$\endgroup\$
  • \$\begingroup\$ I think that your __ would fall under unnecessary variables. Try changing p to a two-letter name and make the string double-quoted to add a backslash for the printed quote. That should compensate for the 3 chars you lost from removing the __,. \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 11:17
  • 1
    \$\begingroup\$ They didn't say not to use them. They said to use at most ten bytes of them. \$\endgroup\$ – SuperJedi224 Apr 9 '15 at 12:49
  • \$\begingroup\$ It meant that you can use necessary variables of up to 10 bytes, but you can't use unnecessary variables altogether. \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 13:16
  • \$\begingroup\$ @Rainbolt You're interpreting it as "You can't use more than 10 bytes of (comments), (unnecessary variables), (filling the program with whitespace), or (variable names) longer than 10 bytes", but because of the second reference, I see it as "You can't use (more than 10 bytes of comments), (unnecessary variables), (filling the program with whitespace), or (variable names longer than 10 bytes)". \$\endgroup\$ – LegionMammal978 Apr 9 '15 at 15:28
  • \$\begingroup\$ I've fixed the ambiguity. In the question, var __ is disallowed (not being used in the rest of the program), but renaming p would be acceptable. \$\endgroup\$ – ASCIIThenANSI Apr 9 '15 at 15:53
1
\$\begingroup\$

Round 2: Javascript, 90 bytes

var p="p";alert(p+p+p+"u"+p+p+p.toUpperCase()+"q([#fwSmd"+p.toUpperCase()+"["+p+p+"n");//p
\$\endgroup\$
  • \$\begingroup\$ How about marking this "Round 2"? \$\endgroup\$ – Claudiu Apr 9 '15 at 2:13
  • \$\begingroup\$ The __, would fall under unnecessary variables. \$\endgroup\$ – LegionMammal978 Apr 12 '15 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.