Introduction
For the ones wondering what Befunge exactly is, it is a two-dimensional stack based language made in 1993 by Chris Pressy. I made 7 brain teasers that need to be solved in Befunge-93. This is quite an experimental challenge, but I thought it's worth a shot :). A full list of all commands used in Befunge-93 can be found here.
How to play?
The task is a bit like a cops-and-robbers without the cops. It's just basically cracking submissions in order to get points. Every puzzle contains question marks. These must be replaced by any printable ascii character in the range 32 - 127
, that includes whitespace. See the following example:
??????@
Given is that the output must be hi
. After some puzzling, we can find out that the solution was:
"ih",,@
But! You do not give the solution. That is for the prevention of cheating. You don't post the solution, but the hash. The hash is generated with the following snippet:
String.prototype.hashCode = function() { var namevalue = document.getElementById("inputname").value; var namenumber = 123;for (var character = 0; character < namevalue.length; character++) {namenumber += namevalue.substring(0, 1).charCodeAt(0);}var hash = 123 + namenumber, i, chr, len;if (this.length === 0) {return 0;}for (i = 0, len = this.length; i < len; i++) {chr = this.charCodeAt(i);hash = ((hash << 5) - hash) + chr; hash |= 0; }hash = Math.abs(hash);if ((hash).toString(16).length < 20) {for (var rand = 123; rand < 199; rand++) {hash = hash * rand;if ((hash).toString(16).length >= 20) { break; }}}return (hash).toString(16).substring(2, 12);};function placeHash() { var pretext = document.getElementById("inputhash").value; var resultinghash = pretext.hashCode(); document.getElementById("resulthash").innerHTML = 'Your hash: <span class="hashtext">' + resultinghash + "</span>";}
p {font-family: monospace;color: black;} .hashtext{color: red;font-weight:bold}
<div class="container"><p>Personal hash generator:<p><textarea id="inputhash" placeholder="Your submission" cols="40" rows="4"></textarea><br><textarea id="inputname" placeholder="Your name" cols="40" rows="1"></textarea><br><button class="hashbutton" onclick="placeHash()">Generate Hash!</button><br><p id="resulthash">Your hash:</p></div><!-- Created by Adnan -->
How to use the snippet?
- First, paste the solution into the submission section
- Second, enter your username (nothing else, this will actually be verified after the time limit)
- Third, press Generate Hash! to obtain your personal hash.
- Copy and paste the hash into your submission.
The puzzles
Puzzle 1 (Score: 3)
??
??? ?
??????????
@
Output (note the trailing whitespace):
1 2 3 4 5 6 7 8 9 10
Puzzle 2 (Score: 3)
???? ?
??????????
?? ?
@
Output:
abcdefghijklmnopqrstuvwxyz
Puzzle 3 (Score: 5)
?????????
????? ???
? ?
? ? ? ?
?
? ?
?????? ? ?
? ? ?
? ? @
??????? ?
? ?
???? ??
? ??
Output:
Hello World!
Puzzle 4 (Score: 2)
??????@
Output (note the trailing whitespace):
123
Puzzle 5 (Score: 5)
?
?????
???@?????
??????
?????????
Output:
Befunge
Puzzle 6 (Score: 5)
? ? ?
?
??????????
?
?
???????? ??????????????
?????"floG edoC dna selzzuP gnimmargorP "??????
@
Output:
###################################
Programming Puzzles and Code Golf
###################################
Puzzle 7 (Score: 3)
???? ?????
???????
@???????
Output:
012345678910
- This is code-challenge, the person with the most amount of points wins!
- In case of a tie, the person who submitted all submissions first, wins.
- The last day for submission is January 10 UTC. After that, you have 2 days to post the full solution, with the hashes already included. These will be verified :).
How to post?
Use the following snippet to post your submission:
#N solutions:
Puzzle 1: `[hash 1]`
Puzzle 2: `[hash 2]`
etc.
It is not necessary to solve the puzzles in order. All programs have been tested here and will be used for verification.
Good luck!
?
with spaces)? \$\endgroup\$