Print the first character of the previous answers

17

1

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).

ASCIIThenANSI

Posted 2015-04-07T17:45:39.307

Reputation: 1 935

"Unnecessary whitespace" is bad wording. Python's whitespace to end statements is unnecessary, because you can use semicolons. – EMBLEM – 2015-04-07T18:17:55.533

Did you notice that this will end with only 9 to 10 answers ? – Optimizer – 2015-04-07T18:17:55.697

@Optimizer I think 10+ is possible - each answer reduces the available space by 5 bytes, and increases the requirement by 1, so the hard limit is probably 16 answers. – isaacg – 2015-04-07T18:19:44.440

@isaacg assuming that golfing languages are still available at 10+ answer stage. – Optimizer – 2015-04-07T18:20:19.240

@Optimizer Languages can be repeated. – isaacg – 2015-04-07T18:20:49.410

@isaacg ah. my bad in that. – Optimizer – 2015-04-07T18:22:01.180

Can we use non-printable ascii? – jimmy23013 – 2015-04-07T18:50:51.453

@user23013 Only if it's not the first character, so we don't ruin the whole challenge. It still counts to bytes, and you have to mark where the characters are. Other than that, it should be OK. – ASCIIThenANSI – 2015-04-07T18:52:38.693

What's the purpose of "Your code must have one print statement/function"? Can we use GolfScript or CJam that print the stack automatically without a print statement? Alternatively, can we use two or more print statements or print the characters one by one in a loop? – jimmy23013 – 2015-04-07T18:55:14.067

@user23013 Yes. I think I messed that one up, it just has to print to STDOUT. – ASCIIThenANSI – 2015-04-07T18:57:04.330

8Perhaps, 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. – Sanchises – 2015-04-07T20:22:00.283

@sanchises What would happen after 100 answers? – LegionMammal978 – 2015-04-07T20:37:40.507

@LegionMammal978 The universe will end. – Sanchises – 2015-04-07T20:48:20.813

@LegionMammal978 Well, this answer encodes and prints 17 letters in only 15 bytes. It can just keep going until no-one can add any more answers. But just in case someone is able to get all 18 in 10 bytes, we should have to wait 24 hours before restarting from 100.

– Scimonster – 2015-04-07T21:12:39.417

@Scimonster I'd be impressed if anyone did that. – ASCIIThenANSI – 2015-04-07T21:17:13.887

@ASCIIThenANSI So would i, but it might be possible. That's why i suggest giving it 24 hours to be pretty sure that no more golfing is going to be done. – Scimonster – 2015-04-07T21:19:10.917

@Scimonster Agreed. – ASCIIThenANSI – 2015-04-07T21:24:13.697

1@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. – Sanchises – 2015-04-07T21:30:15.157

2@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. – ASCIIThenANSI – 2015-04-07T21:35:28.173

Can your answer print any printable characters that aren't part of previous answers? I think it's possible to write a 10 byte golfscript that just prints the ASCII characters 18 times. – Nzall – 2015-04-08T21:30:06.897

⯋劳⽐̡㋰Ύ褞⺄祳PΏ -- can anybody decode this ? – Willem – 2015-04-09T04:32:14.937

6-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. – Geobits – 2015-04-09T13:07:05.700

Please read the comments on this answer and, if you don't mind, edit the question to address the ambiguity.

– Rainbolt – 2015-04-09T15:35:19.567

@Rainbolt I've fixed the ambiguity. This means you can't define a bunch of variables, and then print the characters without using them. In the linked question, var __ is disallowed, but renaming p would be acceptable. – ASCIIThenANSI – 2015-04-09T15:51:58.807

@bcsb1001 Nope. GolfScript did it in 35: http://codegolf.stackexchange.com/a/48673/38891

– ASCIIThenANSI – 2015-04-09T16:00:04.500

18 chars in 10 bytes, anyone? – mbomb007 – 2015-04-10T16:55:14.753

@mbomb007 Might be possible. 15-bytes surprised everyone. – ASCIIThenANSI – 2015-04-10T17:13:18.910

Yeah, but that wasn't a programming language, but rather an encoding. The characters necessary now aren't possible due to data density and current encodings. – mbomb007 – 2015-04-12T20:12:44.807

@mbomb007 Maybe you could encode some golfing language in 7-bit ASCII. – ASCIIThenANSI – 2015-04-13T00:20:18.610

It doesn't look like it's going to happen. – SuperJedi224 – 2015-05-15T21:37:08.973

Answers

34

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.)

isaacg

Posted 2015-04-07T17:45:39.307

Reputation: 39 268

2Congratulations! You are the only person I've seen to compress a string longer than the code it's included in! :D – ASCIIThenANSI – 2015-04-07T21:08:43.640

@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. – Calvin's Hobbies – 2015-04-08T00:26:32.923

6@Calvin'sHobbies This would be easier if we had all just started all our code with the letter 'p'. :D – ASCIIThenANSI – 2015-04-08T01:25:11.087

4-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. – Runer112 – 2015-04-09T13:36:22.153

The first 6 bytes look okay now, but it seems something goes wrong after that. For instance, it seems that the seventh byte should be ('q'<<7)+'(', which is a8, not d1. – Runer112 – 2015-04-09T14:22:19.483

@Runer112 I figured out the bug, my generation program dropped the initial 0 bit on ). I'll have it fixed in a moment. Thanks for catching this. – isaacg – 2015-04-09T21:39:23.923

So, I know this is off-topic, but does 7-bit ASCII converted to 8-bit turn 0110111 0100100 into 01101110 100100...? Is that why it looks like it's printed weird? – ASCIIThenANSI – 2015-04-10T13:41:44.970

@ASCIIThenANSI Yes, that's how the format works. I'm just displaying it byte by byte. – isaacg – 2015-04-11T04:10:39.557

1It should be "áï<SO><DC4>8¨¶7z{rP¶". – LegionMammal978 – 2015-04-12T15:08:39.960

25

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.

PhiNotPi

Posted 2015-04-07T17:45:39.307

Reputation: 26 739

1Very clever, sir. Very clever... – ASCIIThenANSI – 2015-04-07T18:44:28.080

10

Clip, 20 bytes

[M"ppuppPq([#fwSmdP"

bcsb1001

Posted 2015-04-07T17:45:39.307

Reputation: 450

6I think you are the last one standing. Unless somebody can compress ppuppPq([#fwSmdP[ in 15 bytes AND output it. – Sanchises – 2015-04-07T20:01:55.763

@sanchises If anyone does, I'd award a bounty. Because it would be just that good. – ASCIIThenANSI – 2015-04-07T20:12:54.650

3@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[. – bcsb1001 – 2015-04-07T20:14:22.353

1@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. – Sanchises – 2015-04-07T20:20:17.493

1@sanchises But would that break a standard loophole rule by going out to the internet? – ASCIIThenANSI – 2015-04-07T20:38:59.910

5

Common Lisp, 65 bytes

(print(map 'string #' code-char #(112 112 117 112 #x70 80 #x71)))

Geobits

Posted 2015-04-07T17:45:39.307

Reputation: 19 061

The last 112 should be changed to 80 (somehow). – LegionMammal978 – 2015-04-07T19:09:12.530

12With this answer, an age of darkness has been ushered in. – PhiNotPi – 2015-04-07T19:49:01.417

5

Scratch, 45 bytes

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

Byte count as per text representation. See meta.

Scimonster

Posted 2015-04-07T17:45:39.307

Reputation: 2 905

Nice job. I never thought of using Scratch. – ASCIIThenANSI – 2015-04-07T19:41:37.360

4

Python 3, 95 bytes

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

isaacg

Posted 2015-04-07T17:45:39.307

Reputation: 39 268

4

Haskell, 35 bytes

main = putStrLn "\&ppuppPq([#fwS\&"

user19057

Posted 2015-04-07T17:45:39.307

Reputation: 311

What does "&" do? – Hjulle – 2015-04-07T20:05:23.103

4@Hjulle Take up two characters. (It's an escape code for the empty string.) – user19057 – 2015-04-07T20:06:52.900

4

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");}}

EMBLEM

Posted 2015-04-07T17:45:39.307

Reputation: 2 179

1How about marking this "Round 2"? – Claudiu – 2015-04-09T02:13:15.637

4

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

EMBLEM

Posted 2015-04-07T17:45:39.307

Reputation: 2 179

3

Java, 100 bytes

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

EMBLEM

Posted 2015-04-07T17:45:39.307

Reputation: 2 179

3

Mathematica, 75 bytes

Print[StringJoin[First/@Characters/@{"publ","pre=","usin","p1 =","prog"}]];

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

3

F#, 60 bytes

[<EntryPoint>]let main arg=System.Console.Write "ppuppPq(";0

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

3

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.

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

1You forgot the 'w' from Scratch. – ASCIIThenANSI – 2015-04-07T19:54:17.700

I think this is also missing the 'f' from the 50 byte javascript answer. – user19057 – 2015-04-07T19:59:29.387

Fixed that, too – LegionMammal978 – 2015-04-07T20:01:24.960

3

Round 2: ///, 65 bytes

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

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

rodolphito

Posted 2015-04-07T17:45:39.307

Reputation: 795

2

C#, 90 bytes

using System;namespace IAmAwesome{class Program{static void Main(){Console.Write("pp");}}}

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

2

Ruby, 70 bytes

q = ["publ", "pre", "usi", "p1 ", "pro", "Pri"]
q.each{|s| print s[0]}

EMBLEM

Posted 2015-04-07T17:45:39.307

Reputation: 2 179

You'd have to rearrange it to ["publ", "pre", "usi", "p1 ", "pro", "Pri"]. – LegionMammal978 – 2015-04-07T19:06:31.163

2

C, 55 Bytes

#include<stdio.h>
int main(){return puts("ppuppPq([");}

user19057

Posted 2015-04-07T17:45:39.307

Reputation: 311

It should be changed to "ppuppPq([". – LegionMammal978 – 2015-04-07T19:23:15.197

@LegionMammal978 Thanks, fixed. – user19057 – 2015-04-07T19:24:05.697

2

JavaScript, 50 bytes

function foo() {console.log("ppuppPq([#");}
foo();

EMBLEM

Posted 2015-04-07T17:45:39.307

Reputation: 2 179

It should be ppupPq([# – ASCIIThenANSI – 2015-04-07T19:34:31.037

3@ASCIIThenANSI I don't think so. – Scimonster – 2015-04-07T19:35:15.767

2

MATLAB, 30 bytes

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

Nicely shows how loose MATLAB goes about with data types.

Sanchises

Posted 2015-04-07T17:45:39.307

Reputation: 8 530

2

Mathematica, 25 bytes

Print["ppuppPq([#fwSmd"];

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

1I 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. :-/ – Runer112 – 2015-04-07T20:04:32.157

@Runer112 You and all your little rhymes / Still, I had this answer ~20 seconds before the 30-byte one chimed. – LegionMammal978 – 2015-04-07T20:06:17.883

2

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

bloo

Posted 2015-04-07T17:45:39.307

Reputation: 79

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. – EMBLEM – 2015-04-09T05:34:03.237

1Ah, alright cool, I'll just stick a comment in there. – bloo – 2015-04-09T05:38:42.000

3@EMBLEM It's because the Windows newline is \r\n. There are 7 extra \rs there. – jimmy23013 – 2015-04-09T05:41:20.777

2

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).

bcsb1001

Posted 2015-04-07T17:45:39.307

Reputation: 450

2

Round 2, Mathematica, 40 bytes

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

Yay second page!

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

Isn't the output missing a c? – plannapus – 2015-04-09T13:45:48.533

1@plannapus It was, fixed – LegionMammal978 – 2015-04-09T13:46:55.167

2

Round 2, Golfscript, 35 bytes

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

No waste bytes. Starts with a quote again!

Claudiu

Posted 2015-04-07T17:45:39.307

Reputation: 3 870

7-bit ASCII won't work here, it only creates 28 bytes and includes an extra NUL – LegionMammal978 – 2015-04-09T19:45:53.223

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.. – Claudiu – 2015-04-09T19:48:17.560

No, 6 bits would create 24 bytes, but we need 30. – LegionMammal978 – 2015-04-09T20:05:19.693

@LegionMammal978: Right, 24 bytes, then 8 six-bit instructions to print them or do whatever – Claudiu – 2015-04-09T20:32:03.847

Aren't we close to running into a limit here? – John – 2015-04-09T23:05:34.427

1You're missing the apostrophe from 2 answers back – 14mRh4X0r – 2015-04-10T10:05:19.367

@14mRh4X0r An easy fix, though; Claudiu can just add the ' and remove the x. – bcsb1001 – 2015-04-10T10:37:25.840

Oops, guess I missed it twice. Thanks guys. – Claudiu – 2015-04-10T16:08:15.103

Would adding two unprintable characters count as cheating? – rodolphito – 2015-04-11T07:35:11.213

@Rodolvertice You can add them, but you shouldn't put them at the start of your code. – LegionMammal978 – 2015-04-11T12:34:24.820

I meant as in using 7 bit ASCII and filling in the last 2 spaces with unprintables – rodolphito – 2015-04-12T02:03:46.233

@Rodolvertice No, then. – LegionMammal978 – 2015-04-12T15:11:58.023

1

Python 3, 85 bytes

p1 = 'publ'
p2 = 'pre'
p3 = 'usi'
def cprint():
  print(p1[0], p2[0], p3[0])
cprint()

ASCIIThenANSI

Posted 2015-04-07T17:45:39.307

Reputation: 1 935

1

Round 2, C#, 95 bytes

namespace Cool{class Program{static void Main(){System.Console.Write("ppuppPq([#fwSmdP[pp");}}}

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

How about marking this "Round 2"? – Claudiu – 2015-04-09T02:13:24.657

1

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

SuperJedi224

Posted 2015-04-07T17:45:39.307

Reputation: 11 342

How about marking this "Round 2"? – Claudiu – 2015-04-09T02:13:32.657

The __, would fall under unnecessary variables. – LegionMammal978 – 2015-04-12T15:10:43.103

1

Round 2, Javascript, 60 bytes

var _p="p";alert(_p.repeat(2)+"uppPq([#fwSmdP[ppnvos\"R\\");

SuperJedi224

Posted 2015-04-07T17:45:39.307

Reputation: 11 342

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 __,. – LegionMammal978 – 2015-04-09T11:17:04.403

1They didn't say not to use them. They said to use at most ten bytes of them. – SuperJedi224 – 2015-04-09T12:49:14.207

It meant that you can use necessary variables of up to 10 bytes, but you can't use unnecessary variables altogether. – LegionMammal978 – 2015-04-09T13:16:17.007

@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)". – LegionMammal978 – 2015-04-09T15:28:50.857

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. – ASCIIThenANSI – 2015-04-09T15:53:26.230

1

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.

LegionMammal978

Posted 2015-04-07T17:45:39.307

Reputation: 15 731

1

Round 2, R, 50 bytes

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

plannapus

Posted 2015-04-07T17:45:39.307

Reputation: 8 610

0

Round 2: Python, 85 bytes

os=['p']*8
os[4:6]=u'P'+r'q([#fwSmdP'
os[2:2]='u'
os[-2:-2]='['
print''.join(os)+'nv'

Starts with the fundamentals - the 'p's - and builds it up from there.

Claudiu

Posted 2015-04-07T17:45:39.307

Reputation: 3 870

Prints ppuppPq([#fwSmdP[ppp, should be ppuppPq([#fwSmdP[ppnv – EMBLEM – 2015-04-09T02:32:50.890

@EMBLEM: Oops, silly me. Thanks, fixed. – Claudiu – 2015-04-09T05:08:07.480

0

Round 2: VBS, 80 bytes

s = "ppuppPq([#fwSmdP[ppnvo" : For i=1 To 22 : WScript.Echo Mid(s ,i , 1) : Next

Left field language.

Comintern

Posted 2015-04-07T17:45:39.307

Reputation: 3 632