Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 17602

Tasks involving writing interpreters for various languages or formalisms.

7 votes

Make a ;# interpreter

Retina 0.8.2, 34 32 bytes T`;#\x00-\xFF`\x7F\x00_ \+T`\x7Eo`\x00-\x7F_`\x7F[^\x7F]|\x7F$ Try it online! Includes test case. Edit: Saved 2 bytes with some help from @MartinEnder. Now uses TIO link w …
Neil's user avatar
  • 177k
0 votes

Bucket interpreter

Charcoal, 66 bytes NθNηF⁺eES≡ιf≔θζF≔ηεe≔⁰ζE≔⁰εpF∧ζ‹εη«≦⊖ζ≦⊕ε»PF∧η‹ζθ«≦⊖ε≦⊕ζ»o⟦Iζ⟧O⟦Iε Try it online! Link is to verbose version of code. Implements the variant of Bucket specified in the question. …
Neil's user avatar
  • 177k
0 votes

Bucket interpreter

Retina 0.8.2, 184 bytes \d+ $*1, [^FfEePpOo](?=.*$) {`(1+),1*¶((.+¶)f|F) $1,$1¶$3 ,1*¶((.+¶)e|E) ,¶$2 (1?)(¶\1(1*)1*,\3)¶p $2$1¶ ^((1*)(1?)1*,\2)(¶1+,1*)\3¶P $1$3$4¶ }s`,(1*)(¶(.+¶)o|¶O)(.*) ,$1$3¶$ …
Neil's user avatar
  • 177k
4 votes

Talk interpreter

Retina 0.8.2, 18 11 bytes (.)\1 !`.$ Try it online! Link includes test cases. Takes input concatenated. Saved 6 bytes thanks to @CowsQuack for pointing out that removing all doubled characters and …
Neil's user avatar
  • 177k
1 vote

Talk interpreter

Charcoal, 16 bytes F⪪η²F⁼θ§ι⁰≔§ι¹θθ Try it online! Link is to verbose version of code. Takes separate arguments. Explanation: F⪪η² Split the instructions into pairs of digits and loop over them. …
Neil's user avatar
  • 177k
2 votes

Build an interpreter for "Goggle kids Code"

Retina 0.8.2, 135 bytes , \d+ $* +`\([^()]+\)x|(?<=\(([^()]+)\)x1*)1 $1 ^ 0 {`(\d)/(\D*)((1)|0)? $1$#4$2 (\d)\\(\D*) $2$1 (?=(10>|(.)\2=))?.\d[>=](\D*) $#1$+0 Try it online! Link includes test cas …
Neil's user avatar
  • 177k
0 votes

Write an interpreter for "interpreter"

Charcoal, 31 bytes F⪪S ≡№ιi¹≔⁰θ²≦⊕θ³≦⊖θ⁴≦⊗θ⁵≦⊘θ⟦Iθ Try it online! Explanation: F⪪S Split the input on spaces and loop over each word. ≡№ιi Count the number of is in each word. ¹≔⁰θ²≦⊕θ³≦⊖θ⁴≦⊗θ⁵≦⊘θ …
Neil's user avatar
  • 177k
0 votes

Write an interpreter for "interpreter"

Batch, 206 bytes @set/ps= @set t=@set "s= %t%%s:nterpreter=% %t%%s: =&set/an% %t%%s:set/aniiiiii=call:c% %t%%s:iiiii=/=2% %t%%s:iiii=*=2% %t%%s:iii=-=1% %t%%s:ii=+=1% %t%%s:i==0% @set/an%s% @exit/b :c …
Neil's user avatar
  • 177k
2 votes

Write an interpreter generator

Charcoal, 35 bytes ”y≔⁰θF⁺Sψ≡ι”FA⭆⪪”y≔,θI,θ”,⁺§ιλκ”yIθ Try it online! Generates this Charcoal program: ≔⁰θF⁺Sψ≡ιa≔XθI3θb≔×θI2θc≔⁺θI15θd≔⎇⁰θI0θe≔∕θI8θIθ Try it online! Explanation: ”y≔⁰θF⁺Sψ≡ι” Prin …
Neil's user avatar
  • 177k
3 votes

Make a +-= Interpreter

Charcoal, 16 bytes IE⌕Aθ=⁻ι⁺κ⊗№…θι- Try it online! Link is to verbose version of code. Explanation: θ Input string ⌕A Find all indices of = Litera …
Neil's user avatar
  • 177k
1 vote

Make a +-= Interpreter

Retina 0.8.2, 44 bytes = =¶$`= -1=A` %O`. +`\+- ((-)+|\+*)=+ $2$.1 Try it online! Link includes test cases. Explanation: = =¶$`= Prepend all of the prefixes of the input that end in an =. -1=A` De …
Neil's user avatar
  • 177k
4 votes

Implement a 2fuck interpreter

Charcoal, 126 bytes WS⊞υιUO⌈EυLιLυ P⪫υ¶≔⪪⮌S¹θ≔E׳⁰φ⁰η≔⁰ζ≔⁰εWKK«≔﹪§ηζ²⁵⁶δ≡ι<≔⁴ε>≔⁰ε^≔²εv≔⁶ε[≦⊖ζ]≦⊕ζ-§≔ηζ⊖δ+§≔ηζ⊕δ?≧⁺∧δ²ε.≔⁺ω℅δω,F¬¬θ§≔ηζ℅⊟θP⁰M✳ε»⎚ω Try it online! Link is to verbose version of code. T …
Neil's user avatar
  • 177k
2 votes

Implement Subleq

Charcoal, 45 bytes W‹ⅈLθ«≔§θ⊕ⅈι§≔θι⁻§θι§θ§θⅈ¿›§θι⁰M³→J§θ⁺²ⅈ⁰»⭆¹θ Try it online! Link is to verbose version of code. Explanation: W‹ⅈLθ« Repeat while the instruction pointer is within range. ≔§θ⊕ⅈι …
Neil's user avatar
  • 177k
1 vote

µUnitDC: A unit-aware RPN calculator

Charcoal, 123 116 bytes F⪪S ¿Σι⊞υ⁺⟦Iι⟧Eβ⁰¿№βι§≔§υ±¹⊕⌕βι¹«≔⊟υζ≔⊟υη⊞υ∧∨⬤∧ζη∨¬λ⁼κ§ζλ⁻+ιE∧ζη⎇λ⁻κקζλ⊖﹪℅鳧⟦×κ§ζλ⁺κ§ζλ÷κ§ζλ⟧℅ι»Eυ⭆∨ι*⎇μ⎇λ⁺§β⊖μλωλ Try it online! Link is to verbose version of code. Since t …
Neil's user avatar
  • 177k
2 votes

Interpret PlusOrMinus

Charcoal, 19 bytes ⭆⌕AΦS№+-ι-℅﹪⁻ι⊗κ²⁵⁶ Try it online! Link is to verbose version of code. Explanation: S Input string Φ Filtered where +- Literal …
Neil's user avatar
  • 177k

15 30 50 per page