Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/lasso9
|
||||
|
||||
// filename: interactive_demo
|
||||
|
||||
define concatenate_with_delimiter(
|
||||
string1::string,
|
||||
string2::string,
|
||||
delimiter::string
|
||||
|
||||
) => #string1 + (#delimiter*2) + #string2
|
||||
|
||||
define read_input(prompt::string) => {
|
||||
|
||||
local(string)
|
||||
|
||||
// display prompt
|
||||
stdout(#prompt)
|
||||
// the following bits wait until the terminal gives you back a line of input
|
||||
while(not #string or #string -> size == 0) => {
|
||||
#string = file_stdin -> readsomebytes(1024, 1000)
|
||||
}
|
||||
#string -> replace(bytes('\n'), bytes(''))
|
||||
|
||||
return #string -> asstring
|
||||
}
|
||||
|
||||
local(
|
||||
string1,
|
||||
string2,
|
||||
delimiter
|
||||
)
|
||||
|
||||
// get first string
|
||||
#string1 = read_input('Enter the first string: ')
|
||||
|
||||
// get second string
|
||||
#string2 = read_input('Enter the second string: ')
|
||||
|
||||
// get delimiter
|
||||
#delimiter = read_input('Enter the delimiter: ')
|
||||
|
||||
// deliver the result
|
||||
stdoutnl(concatenate_with_delimiter(#string1, #string2, #delimiter))
|
||||
Loading…
Add table
Add a link
Reference in a new issue