Kudos to anyone who can identify this language without googling it.
hangman := function()
local answer, badguesses, guess, i, nrguesses, secret, stream;
secret := "recitative";
answer := List([1 .. Length(secret)], x -> '*');
ConvertToStringRep(answer);
nrguesses := 7;
badguesses := 0;
stream := InputTextUser();
while badguesses < nrguesses do
Print("Guess a letter: \c");
guess := ReadLine(stream)[1];
if guess in secret then
Print("Good guess \n");
for i in PositionsProperty(secret, x -> x = guess) do
answer[i] := guess;
od;
else
Print("Bad guess \n");
badguesses := badguesses + 1;
fi;
Print(answer, "\n");
if answer = secret then
Print("You win!");
return;
fi;
od;
Print("You failed miserably. The word was ", secret, ".");
return;
end;