Stupid Coding Tricks: Sudoku solver in Brainfuck!
-
About 8 years ago, I posted this: Stupid Coding Tricks: Sudoku solver in Whitespace!
Well, I may have "jumped the shark" by finally recreating my solver in Brainfuck: Sudoku.7z
Just as before, this was done as a test of a compiler for a high-level language I designed (it's a bit like C, but supports generics on struct types).
Unfortunately, it doesn't seem to work well in online brainfuck interpreters - uncompressed it's a 3.75 MB program, and for some reason crashes Chrome when I try to paste it all into a text box.
If you're interested, it seems to work great on the optimizing Brainfuck to Python compiler bfc.py posted here: https://www.nayuki.io/page/optimizing-brainfuck-compiler although I'm sure it'll work on pretty much any compiler/interpreter.
-
@Huf_Lungdung Well, fuck! Welcome back?
Edit: Hot dang, that link still works!
@Huf_Lungdung said in Stupid Coding Tricks: Sudoku solver in Whitespace!:
Thanks. That's a really cool website.
http://whitespace.pastebin.com/f761fc4b5
Note that you can't copy & paste the code because it seems to add indented line numbers. Use the "download" link instead.
You can't often say that about websites from that era...
-
@Huf_Lungdung said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
uncompressed it's a 3.75 MB program
I can fix that:
https://github.com/BenLubar/bit/tree/master/cmd/brainfuckc
Now it's no longer 3.75 megabytes!
-
@ben_lubar Why not write a compiler for Brainfuck in BIT, targeting x86?
-
@dkf something something quixotic ideas thread?
-
@Tsaukpaetra said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
You can't often say that about websites from that era...
Especially pastebins. Hot damn.
Also, good work @Huf_Lungdung
-
@dkf said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
@ben_lubar Why not write a compiler for Brainfuck in BIT, targeting x86?
I could write a Brainfuck-to-x86 compiler in a subset of Scala and then compile it to BIT.
-
@ben_lubar said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
I could write a Brainfuck-to-x86 compiler in a subset of Scala and then compile it to BIT.
If you see people in long, white outfits approaching, don't panic, they're there to help you.
-
@ben_lubar said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
@dkf said in Stupid Coding Tricks: Sudoku solver in Brainfuck!:
@ben_lubar Why not write a compiler for Brainfuck in BIT, targeting x86?
I could write a Brainfuck-to-x86 compiler in a subset of Scala and then compile it to BIT.
i challenge you to write it from scratch in BIT. it's not a proper language if no one writes code for it directly. if you only transpile code for it it's an intermediary language not a programming language.
make BIT a real language again.
-
@ben_lubar Just write LLVM front and backends for it like a normal person.