Super Quine

Post Reply
User avatar
lechat
Posts: 12
Joined: Wed Feb 27, 2008 10:16 am

Super Quine

Post by lechat »

Hi adum,
I wrote a program for the Super Quine, it works fine (I hope) in ptest.php but on the challenge page I get always 503 Error:

Code: Select all

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Is it due to errors in the program or glitches on the server?

Regards,
lechat
User avatar
lechat
Posts: 12
Joined: Wed Feb 27, 2008 10:16 am

Post by lechat »

Got it!
Errors in the program :twisted:
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

In this challenge, what end of the line character(s) should we print? 0xd... 0xa... or 0xd 0xa? ;)

Is the challenge picky about differences in trailing end of lines printed or not printed vs the code we enter?

I have a program which seems to print itself out. When i submit it, it tells me my program is wrong, but the expected vs got looks identical to me, even with end of line characters matching exactly (at least from what I can see). I've tried all the 3 different end of line characters above. Maybe I'm suppose to output something different?
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

I just printed newline (e.g. 91+P) at the end of each line.
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

Hrm, then i'm at a loss as to what the differences between the program and the output. Its not long at all (compared to HVM version), and only takes 2175 cycles to run.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

the newline stuff is a bit of a pain. i remove all \r instances. so basically you should try for just \n.
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

Ok, pretty sure i'm just doing \n now. I even tried replacing all my spaces with an alternate character to make sure something wasn't eating multiple whitespaces in my code (as the php version seems to when it prints the output).

I've noticed playing around that printing a '\0' wont show up in the output but caused my string reversal program to be illegal.

Is there something crazy with needed to write an extra '\0' or some other end of file or end of string character?
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

I had a problem where I was printing an extra \n at the end of the program; I don't know if its related to yours but its worth checking.

I noticed that there aren't any goto calls besides @ and $. It'd be nice to be able to jump to a specific location.
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

Ah, finally found the problem. Had to use firefox to see the actual differences between the output.
I had a few '\0' that my program printed out before the '\n' at the end of each line (padding each line to be the same length) and that caused my program to fail.
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

is the solution accepted if your program gives all output and then crashes? (stack underflow for example)
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

no, you have to exit successfully.
ShardFire
Posts: 26
Joined: Wed May 30, 2007 4:26 pm
Location: United Kingdom

Post by ShardFire »

The v instruction doesn't appear to be functioning as expected when there are multiple threads with stacks on the same memory row. This is in both the javascript and the checker code. However, the ^ instruction does work (as far as I know).
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

hmmn, that is not something i've tested, so i can certainly believe it's not working right. can you give some sample code that behaves differently from what you would expect? thanks.
ShardFire
Posts: 26
Joined: Wed May 30, 2007 4:26 pm
Location: United Kingdom

Post by ShardFire »

This seems like a good example:

Code: Select all

432&\10....ppppp!
~~~~1~
~/\~v~
~\/s/
It's quite clear what it should print I think so I shall say no more. This example fails on both implementations... Note that both threads write 1 on the same cycle (by design) so the correct value is there for both.
Post Reply