Super Small Quine

Discussion of challenges you have already solved
Post Reply
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Super Small Quine

Post by gfoot »

Hmm, I'm getting penalised for printing a newline after the last line. If my input ends with a newline, the area calculation charges me for a whole additional line. I think that's a bit unfair - the next line should only be counted if it's non-empty. The final newline ought to be considered a terminator for the previous line.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

good point, i'll fix that
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

Whoo! That was tricky!

As for the extra newline: is it also fixed for the normal quine? I remember running into that problem aswell...
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

okay, should be fixed
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

efe: I'm assuming you're doing a 1-liner too?
Do you want to share code?
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

@therethinker:

My solution:

Code: Select all

0@@@@@@ 01^gx?s!P1+$
Have you got the same? If not, please post yours too!
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

Yeah, the trick seems to be working out how to do bounded loops on one line. Mine is a bit different, but it comes out the same length.

It would be nice if $ with an empty call stack terminated the current thread, ending the program if all threads have finished.
ShardFire
Posts: 26
Joined: Wed May 30, 2007 4:26 pm
Location: United Kingdom

Post by ShardFire »

I took a completely different approach for this which seems to work by luck :lol:

Code: Select all

0@s!@~@~@@@~01^gP1+$
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

efe: i got exactly the same as you :D
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

I also had the same exact code as efe & m!nus!
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

Mine was identical to ShardFire, except I used spaces instead of tildes, and put them in slightly different places (there's some flexibility there).
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post by teebee »

My solution is essentially the same as the one of ShardFire and gfoot.
swgr
Posts: 7
Joined: Tue Sep 08, 2009 1:56 pm

Post by swgr »

mine:

Code: Select all

0@s!@ @@@ @ 01^gP1+$
And, it seems that printing some more \0 will result in 'incorrect', but the return message will not contain those \0 in the tail. So I gets something like:

Code: Select all

<font color=red>Expected: 
'0@s!@@@@@@ x01vgP1+$', got: 
'0@s!@@@@@@ x01vgP1+$'</font><br> Your King of the Hill score is 20. <font color=aa0000><b>'0@s!@@@@@@ x01vgp1+$' is incorrect.</b></font><p>
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

I posted the same as gfoot except I have used ShardFires positions, I was lazy to submit vertical one using x instead of 1^.

Actually vertical solution is a nonsense:(.
I have improved my solution to @s!@0@ @@@ 01^gP1+$? length 19 with a dummy char.
With option to use @0@@ @@ instead and write all except the $ just to shorten it one char...
Post Reply