Niels G. W. Serup
2 February 2025
#!/usr/bin/env rash
>echo Please enter the first number.
read number1
>echo Please enter the second number.
read number2
result=>expr ${number1} + ${number2}
>echo ${number1} + ${number2} = ${result}
can(manage(lunch_club)) :-
can(use(chatbot)).
can(manage(lunch_club)) :-
can(use(chatbot)).
can(use(chatbot)) :-
has(irc).
can(manage(lunch_club)) :-
can(use(chatbot)).
can(use_for(chatbot, bookkeeping)) :-
used_at(chatbot, lunch_time).
can(use_for(chatbot, bookkeeping)) :-
used_at(chatbot, lunch_time).
can(use_for(chatbot, ???)).
can(use_for(chatbot, bookkeeping)) :-
used_at(chatbot, lunch_time).
can(use_for(chatbot, Game)) :-
viable_game_for_medium(irc, Game).
can(use_for(chatbot, Game)) :-
viable_game_for_medium(irc, Game).
viable_game_for_medium(irc, ???).
can(use_for(chatbot, Game)) :-
viable_game_for_medium(irc, Game).
viable_game_for_medium(irc, Game) :-
game_for_genre(text_based, Game).
viable_game_for_medium(irc, Game) :-
game_for_genre(text_based, Game).
game_for_genre(text_based, funny_remarks).
viable_game_for_medium(irc, Game) :-
game_for_genre(text_based, Game).
game_for_genre(text_based, Game) :-
state_based_game(Game).
game_for_genre(text_based, Game) :-
state_based_game(Game).
state_based_game(jeopardy).
state_based_game(connect_four).
state_based_game(wheel_of_fortune).
state_based_game(...).
state_based_game(jeopardy).
state_based_game(connect_four).
state_based_game(wheel_of_fortune).
state_based_game(...).
can(play(Game)) :-
state_based_game(Game),
can(keep_state).
can(play(Game)) :-
state_based_game(Game),
can(keep_state).
can(keep_state) :-
has(background_process).
can(keep_state) :-
has(manual_state_file_handling).
can(play(Game)) :-
state_based_game(Game),
can(keep_state).
can(keep_state) :-
has(background_process).
can(keep_state) :-
has(manual_state_file_handling).
can(keep_state) :-
has(rash).
can(play(Game)) :-
state_based_game(Game),
can(keep_state).
can(keep_state) :-
has(rash).
has(rash)
⇓can(keep_state)
⇓can(play(Game)) :- state_based_game(Game)
⇓game_for_genre(text_based, Game)
⇓viable_game_for_medium(irc, Game)
⇓
can(use_for(chatbot, Game))
has(rash)
read
instructionsnumbers=>seq 1 100
numbers_shuffled=<${numbers}>sort -R
random_number=<${numbers_shuffled}>head -n1
>echo Guess the number!
:guess
read guess
>test ${guess} -lt ${random_number}
jz too_low
>test ${guess} -gt ${random_number}
jz too_high
>test ${guess} -eq ${random_number}
jz correct
:too_low
>echo Your guess was too low, try again.
j guess
:too_high
>echo Your guess was too high, try again.
j guess
:correct
>echo Congratulations, you guessed the number!