From: Einar Jørgen Haraldseid Date: Mon, 12 Jun 2017 12:38:25 +0000 (+0200) Subject: Middagsgenerator X-Git-Url: https://git.slaskete.net/einar-bin/commitdiff_plain/a8e53fff45d7885bf3a8f2d1df47f9b48a2651c8?ds=inline Middagsgenerator --- diff --git a/middag.sh b/middag.sh new file mode 100755 index 0000000..9f2b66b --- /dev/null +++ b/middag.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +Prep=( + 'Kokt' + 'Stekt' + 'Grillet' + 'Gratinert' + 'Bakt' +) + +Meat=( + 'laks' + 'biff' + 'kylling' + 'grøt' +) + +Sides=( + 'poteter' + 'ris' + 'wokgrønsaker' + 'kokte grønsaker' + 'fries' + 'salat' +) + +PrepCount=0 +while [ "x${Prep[PrepCount]}" != "x" ]; do + ((PrepCount++)) +done + +MeatCount=0 +while [ "x${Meat[MeatCount]}" != "x" ]; do + ((MeatCount++)) +done + +SideCount=0 +while [ "x${Sides[SideCount]}" != "x" ]; do + ((SideCount++)) +done + +PrepN=$RANDOM +(( PrepN %= $PrepCount )) + +MeatN=$RANDOM +(( MeatN %= $MeatCount )) + +SideN=$RANDOM +(( SideN %= $SideCount )) + +echo "${Prep[PrepN]} ${Meat[MeatN]} med ${Sides[SideN]}"