Skip to content

Instantly share code, notes, and snippets.

@stivenroytman
Created May 3, 2021 18:51
Show Gist options
  • Select an option

  • Save stivenroytman/a75f80d119b44be222a011c5079550d6 to your computer and use it in GitHub Desktop.

Select an option

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.
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"
)
@caseykneale
Copy link

This is a great example of how to use ReplMaker!

@caseykneale
Copy link

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