Search found 43 matches

by a.goth
Sat Dec 24, 2016 9:35 am
Forum: Challenges Solved
Topic: Jeux du Sort
Replies: 52
Views: 25450

Tiny Sort

I again analyzed and shortened your SuperHack program:

Code: Select all

0,2@@@@@@@@@@ ,1v1^?$+xv2vx2^dxdv2v1+x^?$?p01gP22^?$?p!
Happy holidays!
by a.goth
Mon Sep 05, 2016 7:53 pm
Forum: Challenges Solved
Topic: Jeux du Sort
Replies: 52
Views: 25450

Tiny Sort

Hmm, I cannot find my original solution. My current bublesort like solution looks following way (6110 cycles): 0,,@2@@@@@@@@@@ xv2vx2^d1-1^d1+v2v1+x^?$1[,21^?$g1vpP22^?$1vp! (Too long for Kolmogorov KOTH challenge) I am currently working on challenge 'Tiny Sort' and since I could not beat your code...
by a.goth
Tue Aug 16, 2016 6:51 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Code size

Thanks for the congratulations!

My solution to challenge 'Super Fast Brainfuck' has code size 1885, but the SuperHack program consists of only 447 instructions. Furthermore, I still see room for improvement.
by a.goth
Sat Aug 13, 2016 4:24 pm
Forum: Challenges Solved
Topic: Super Fast Brainfuck
Replies: 0
Views: 22419

Super Fast Brainfuck

Although it is required according to the challenge text, I wrote no general-purpose Brainfuck interpreter. Even worse, my solution does not compute all test cases correctly and the SuperHack program was submitted to the server as long as new King of the Hill benchmarks were set: %+.<>f /\ x, 5+ 91 ...
by a.goth
Tue Jul 26, 2016 6:28 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

King of the Hill

Yes, I have climbed the hill!

Next, I might try to solve challenge 'Super Fast Brainfuck', although I still do not know how to use or synchronize threads in SuperHack. For questions, I get back to you via PM if that is okay?
by a.goth
Fri Jul 22, 2016 3:41 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Brainfuck interpreter

How small is your smallest solution? My last approach resulted in an interpreter with code size 189: /%,x\/-\ /02^<x01gd?s!-11^0\ /-x35*-?\14^<p$ /9+-xx*1\/,15^>$ :g10//s+\?d9^2\//s=0s/s*x+0s/-=\g60$?^2\xx*1:x=\8=sv3v3\:14^<+\ \6]s\20g1@/1[1/\:x3^?/116^<?/+s\3v+2v2v/ \0s\4v1v-3v/$0>^41/ I have no cl...
by a.goth
Mon Jul 04, 2016 12:48 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Loop back

The loop implementation is really (time) bottleneck in the interpretter (it costs a lot of time to detect te loop and a lot of time to find where to jump). I would expect jumps to be precomputed in interpret. (Actually this is the only place where interpretter gains against (original) compiller as ...
by a.goth
Fri Jul 01, 2016 2:38 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Nested loops

Actually nested loops are simple in the already implemented code, which didn't try to be fast so no s's are used for back loops ... you count number of opened ['s and put '/','\' given number of lines above or under ('\' is switched with '/' when [ is switched with ]). When using s's an option is t...
by a.goth
Fri Jul 01, 2016 11:02 am
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Compression of consecutive commands

Actually using } instead of 2] would short the code, but for >>> the 6] would become better (what I have not implemented) and actually test cases seems do not contain more than two consecutive >'s so it's definitely thing to consider not only in code size optimization challenge, but even in time op...
by a.goth
Wed Jun 29, 2016 3:40 pm
Forum: Challenges Solved
Topic: Small Brainfuck
Replies: 20
Views: 8787

Brainfuck interpreter

Wow, I am even more impressed. You wrote a multi-threaded compiler which is smaller than my interpreter. (In fact, I have a smaller interpreter, but it requires too many cycles.) First, the whole Brainfuck program is loaded into memory cells (0++, 0). The memory cells (0++, 1) are used as the tape. ...
by a.goth
Mon Jun 27, 2016 2:40 pm
Forum: Challenges Solved
Topic: Super Brainfuck
Replies: 5
Views: 2595

Drop top of stack

That is right, if the program starts with %00 instead of %0, then you can replace 1[, by +,. Or you can use a different arithmetic operation. Nice trick. I will post my solution of challenge 'Small Brainfuck' within the next few days in the appropriate thread. And yes, the SuperHack challenges are r...
by a.goth
Thu Jun 23, 2016 7:43 pm
Forum: Challenges Solved
Topic: Super Brainfuck
Replies: 5
Views: 2595

Brainfuck challenges

Oh yeah, now that you mention it. Initially, I had also considered to solve the Brainfuck challenges that way. The idea was to translate Brainfuck programs into SuperHack using the following substitutions: Brainfuck command | SuperHack equivalent ------------------+--------------------- (Program Sta...
by a.goth
Wed Jun 22, 2016 12:00 pm
Forum: Challenges Solved
Topic: Super Brainfuck
Replies: 5
Views: 2595

Brainfuck challenges

Did I miss something? How are the Brainfuck challenges solved with a compiler?