MercyBeaucou
  • Member for 5 years, 2 months
  • Last seen more than a month ago
  • Seattle, WA, United States
Implement a Truth-Machine
2 votes

Befunge, 4 bytes &:.% Try it online! Please note: this answer is no longer valid with this particular interpreter. At the time of writing, the interpreter used had a quirk where trying to read ...

View answer
2 Cats in a Quine
5 votes

Befunge-98 (FBBI), 8 + 15 = 23 bytes A + B: (only works for no input) +9*5~,#@#@~,9j>:#,_:@#" Try it online! A: +9*5~,#@ Try it online! B: #@~,9j>:#,_:@#" Try it online!

View answer
Merge two values
1 votes

Befunge-93, 20 bytes &::&*#v_&+.@ @.*!-&< Try it online! Explanation this boils down to: if(A * B = 0) { output (A + B) end } else { output A * (A = B) end }

View answer
Prime or highest factor
1 votes

Befunge-98 (FBBI), 39 bytes j&:!+f0p1-1:::' -:!j;3k$.nbj;-\%!!j:1+a Try it online! Ends with the & when there are no more numbers. This causes the program to stall for 60 seconds until TIO ...

View answer
Make an Emergency Corridor
1 votes

Befunge-98 (FBBI), 14 bytes Uses 0 for cars, and 1 for the empty lane. 12&:b0p`j\' k. Try it online! This uses a & to end the program, stalling it until TIO shuts it off, instead of ending ...

View answer
Output the sign
3 votes

Befunge-93 (PyFunge), 12 bytes ~"1"%90p1X.@ Try it online! Note that the X can be anything (except a new line), as it gets written over during run-time. It's just easier for explanation Similar to ...

View answer
Output the sign
5 votes

Befunge 93, 14 13 bytes Golfed off a byte by combining the 2 1s 1~50p :0`_.@. Try it Online! This one is interesting, as it takes the first character of the number and alters the code accordingly. ...

View answer
The Non-Zero Digital Product Challenge
1 votes

Befunge-98 (PyFunge), 14 bytes 1<*+!:-0'~.j@# Try it online!

View answer
Print a 10 by 10 grid of asterisks
2 votes

Befunge-93 (PyFunge), 28 bytes #<90v0-1_@#:, #^_ >1+"*",:9` Try it online!

View answer
What is the missing number (divisibility by 9)
1 votes

Befunge-98 (PyFunge), 15 13 bytes I realized that I don't need to use ? to represent the absent digit, so I used one that is a multiple of 9 after subtracting 48: x This let me golf off the 3+. #v~'...

View answer
What is the missing number (divisibility by 9)
1 votes

Befunge-93 (PyFunge), 22 21 bytes I realized that I don't need to use ? to represent the absent digit, so I used one that is a multiple of 9 after subtracting 48: x This let me golf off the 3+, but ...

View answer
Snakes all around
1 votes

Befunge-98 (FBBI), 22 18 bytes Saved 4 bytes by putting the "-):(" at the beginning. This let me get rid of the separate printing of the head, and also the ' for pushing the =. "-):(=&...

View answer
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 in PHP (or anything else, for that matter)
3 votes

Befunge-98 (PyFunge), 7 bytes ? '/,\' Try it online! the ? sends the IP either left or right, so either / or \ is pushed before printing with ,. When executing the '/ or \' in the wrong order after ...

View answer
Is my barcode valid?
7 votes

Befunge-98 (PyFunge), 16 14 bytes Saved 2 bytes by skipping the second part using j instead of ;s, as well as swapping a ~ and + in the first part to get rid of a + in the second. ~3*+~+6jq!%a+2 ...

View answer
Alphabet Staircase
7 votes

Befunge-98 (FBBI), 27 bytes 1+:0\::'`j'@+\k:$$>:#,_$a, where  is a substitution character (ASCII 26) Try it online! Uses uppercase letters, and has a trailing newline. Explanation ...

View answer
Code 3k to Codee k
2 votes

Befunge-98 (PyFunge), 5 bytes [q/3g Try it online! Outputs via exit code. Explanation First, the IP hits the "turn left" instruction ([) twice, which wraps it back around to the back of the ...

View answer
The shortest code to invert bit-wise a binary string
3 votes

Befunge-98 (PyFunge), 7 bytes 'a#@~-, For every character, c, in the input, it prints the character with an ascii value of 94 - c, where 94 is the value of ‘0’ +’1’, or ‘a’ Try it online!

View answer
Print invisible text
0 votes

Befunge-98 (PyFunge), 5 bytes #@~a, Try it online! For every character in the input (#@~), this prints a new line (a,).

View answer
Script that outputs a script that prints a given input
0 votes

Befunge-98 (PyFunge), 30 bytes '":v ~\#[ <v">:#,_""# <>4k,'@, Try it online! This prints a program in the form "...ihgfedcba">:#,_@, which prints ...

View answer
Diagonal Alphabet
2 votes

Befunge-98 (PyFunge), 30 bytes 1+:0\:'`+\' \k:>:#,_$:'␚-!k@a, Where ␚ is a literal substitute character Every line has 3 leading spaces Try it online!

View answer
Divisibility Streak
2 votes

Befunge, 19 bytes #v_1+::&+1-\% 1<@.- Try it online!

View answer
I double the source, you double the output!
6 votes

Befunge-98 (PyFunge), 3 bytes This answer draws heavy inspiration from this one, go vote them up too! ".@ Try it online! or Try it online doubled! Explanation When wrapping back around to the ...

View answer
Mathematics is fact. Programming is not
1 votes

Befunge-98 (PyFunge), 22 20 bytes Golfed off 2 bytes because I realized that if I used k instead of j to do the logical notting to account for a 0 without a factorial, I didn't have to mod the ASCII ...

View answer
Output the missing integer
3 votes

Befunge 98, 14 12 bytes I saved 1 byte by moving the program onto 1 line and 1 byte by doing some better math ~+;@.%a--7;# Try it online! Explanation The sum of the ASCII values range from 477 to 468 ...

View answer
Print numbers from 1 to 10
0 votes

><>, 10 bytes llnao:9=?; Try it online! Explanation: This program pushes the length of the stack instead of trying to increment the top of the stack, because l is shorter than 1+, and you ...

View answer
From Programming Puzzles to Code Golf
1 votes

Befunge-98, 51 bytes ]@,k9"Code"*84"Golf"; ["selzzuP gnimmargorP">:#,_@; Try it online! The main idea here is to use the "turn right" operator (]) to check if there is a line below the first one....

View answer
Swap the parity
0 votes

Befunge-93, 11 bytes &:2%2*1-+.@ [Try it online!] Explanation: Stack representation: bottom [A, B, C top &: Pushes 2 copies of the input, N: [N, N 2% ...

View answer
Powerprogramming: O(1^N), O(N^1), O(2^N), O(N^2) all in one
4 votes

Befunge-98, 50 bytes Normal \+]#:\-1vk !:;# @k!:-1 .: ;#]#$ <; [*:>@ &$< ^&; This is by far the simplest program of the 4 - the only commands that are executed are the following: \+...

View answer
Stay away from zero
0 votes

Befunge-98, 5 bytes &:!+. Try it Online! (Warning - will take 60 seconds per test because of how TIO treats &) Explanation &: Push 2 copies of the input ! Logical not the ...

View answer
Two roads diverged in a yellow wood (part 1)
0 votes

Befunge 98, 11 bytes -!jv~' @.~< Try it Online! Prints 32 for left, and 35 for right, both with a single trailing space. Explanation -!jv This is a no-op the first time through, but used ...

View answer