added :s to the help text and fixed copy-pasting error

This commit is contained in:
Dario48 2026-03-02 22:18:36 +01:00
commit 482152c303

View file

@ -21,6 +21,7 @@ repl interpreter = do
putStrLn " :h = this text" putStrLn " :h = this text"
putStrLn " :q = quit" putStrLn " :q = quit"
putStrLn " :d = print the state of the array around the index" putStrLn " :d = print the state of the array around the index"
putStrLn " :s = print a table of all symbols and their functionality"
repl interpreter repl interpreter
":q" -> return () ":q" -> return ()
":d" -> ":d" ->
@ -51,11 +52,11 @@ repl interpreter = do
>> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|" >> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|"
>> putStrLn "| . | Output the byte at the data pointer. |" >> putStrLn "| . | Output the byte at the data pointer. |"
>> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|" >> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|"
>> putStrLn "| , | Accept one byte of input, storing its value in the byte at the data pointer.[b] |" >> putStrLn "| , | Accept one byte of input, storing its value in the byte at the data pointer. |"
>> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|" >> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|"
>> putStrLn "| [ | If the byte at the data pointer is zero, jump forward to the command after the matching ] command. |" >> putStrLn "| [ | If the byte at the data pointer is zero, jump forward to the command after the matching ] command. |"
>> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|" >> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|"
>> putStrLn "| ] | If the byte at the data pointer is nonzero, jump back to the command after the matching [ command.[c] |" >> putStrLn "| ] | If the byte at the data pointer is nonzero, jump back to the command after the matching [ command. |"
>> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|" >> putStrLn "|--------+-------------------------------------------------------------------------------------------------------|"
>> repl interpreter >> repl interpreter
brainfuck -> interpreter `execStr` brainfuck >>= repl brainfuck -> interpreter `execStr` brainfuck >>= repl