Created
May 3, 2021 18:51
-
-
Save stivenroytman/a75f80d119b44be222a011c5079550d6 to your computer and use it in GitHub Desktop.
A custom Julia REPL mode that memes back at you in spongebob spek whatever you say.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ReplMaker | |
| function spongespek(phrase::String) | |
| casecounter = 0 | |
| spek = "" | |
| for letter in phrase | |
| casecounter += 1 | |
| if casecounter % 2 == 1 | |
| spek *= uppercase(letter) | |
| else | |
| spek *= lowercase(letter) | |
| end | |
| end | |
| println(spek) | |
| end | |
| initrepl( | |
| spongespek, | |
| prompt_text="sponge> ", | |
| prompt_color = :yellow, | |
| start_key=')', | |
| mode_name="sponge_mode" | |
| ) |
if you add:
valid_input_checker=complete_julia
it'll work great for JuliaTutor :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a great example of how to use ReplMaker!