Jump to content

Menu: Difference between revisions

6 bytes removed ,  29 days ago
 
Line 1,830:
<syntaxhighlight lang="langur">val .select = impure fn(.entries) {
if .entries is not list: throw "invalid args"
if len(not .entries) == 0: return ""
 
# print the menu
writeln join "\n", map(fn( .e, .i): { $"\{{.i:2;}}: \{{.e;" }}", .entries, 1..len .entries)
 
val .idx = number read(
Line 1,848:
}
 
writeln .select(["fee fie", "eat pi", "huff and puff", "tick tock"])</syntaxhighlight>
</syntaxhighlight>
 
{{out}}
890

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.