Skip to content

Instantly share code, notes, and snippets.

@bunam
Created September 27, 2018 14:21
Show Gist options
  • Save bunam/a10dd57ef937100d3b02d03c4b3f758b to your computer and use it in GitHub Desktop.
Save bunam/a10dd57ef937100d3b02d03c4b3f758b to your computer and use it in GitHub Desktop.
une noucou 2.0
#!/usr/bin/env bash
# nounou 2.0
# say command on mac OS : Making your Mac talk with the sentence you pass, in french there
enfants[0]='Marceau'
enfants[1]='Émile'
actions[0]='range ta chambre'
actions[1]='mets tes chaussons'
actions[2]='vas te laver les dents'
actions[3]='fait tes devoirs'
actions[4]='lave toi les mains'
actions[5]='à table !'
actions[6]='fait le poirier'
function new_action(){
quel_enfant="$(($RANDOM % ${#enfants[@]}))"
quelle_action="$(($RANDOM % ${#actions[@]}))"
message="${enfants[$quel_enfant]}, ${actions[$quelle_action]} !"
}
while true ; do
new_action
echo ${message}
say ${message}
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment