Super Small Hello World

Post Reply
Tenebrar
Posts: 18
Joined: Sun Jan 13, 2008 1:38 pm

Super Small Hello World

Post by Tenebrar »

How would sizes for SuperHack programs be calculated exactly?

Would:

Code: Select all

123
4
5
and

Code: Select all

123
  4
  5
be of the same length? Would that length be 5 or 9? Or would the first be of length 5 and the last of length 9?
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

both are lengths of 9
theStack
Posts: 72
Joined: Sun Nov 02, 2008 12:46 am

Post by theStack »

MerickOWA wrote:both are lengths of 9
So the length is always calculated with (MaximumCodeWidth * MaximumCodeHeight)?

This leads me to another question, namely how is "speed" measured?
There is e.g. the "Fast String Reversal" challenge where the upper boundary is something about 35, but you should reverse a string that could be up to 100 chars. Well this seems quite impossible for me, I mean you *have* to process at least every char once, so how should that be possible in 35 cycles?

So, either I have understood the wrong thing in "speed" or it *is* in fact possible and I'm thinking too complex (I have to admit I have only solved one challenge so far with SuperHack...) or whatever.

// EDIT:
Oh sorry, regarding the SuperHack description my questions are quite senseless, they're both answered there. In short:
Code size -> counted as size of bounding rectangle
Speed -> measured in cycles BUT per cycle there can be more than one thread executed
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Post by megabreit »

I noticed one thing:
" " (Space) does not count as cycle. At least it does not appear in the trace.
Other no-ops like "=" or "|" to beautify program flow do appear in the trace and count as cycle e.g. decrease speed.

Is this true or just a "display" problem?
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

That is in fact a display problem in the javascript implementation.
Space instructions appear in the trace when using the PHP implementation, however...
and of course they count as cycles!
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

Why oh why can't 'd' divide S0 by S1?! Then I could simply have something like:
codehereHello, World!
and it would terminate properly and everything, as long as by the end of the code there was a value on the stack. Grr.
There is no spoon.
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

After a long think I have found a promissing layout to replace my "generic" 32 instruction solution ... I have found 2 other 32 instruction solutions and now 30 instruction solution ... and another 30 instruction one:(.
And now another 2 solutions in 30 (different layouts).
Post Reply