Middagsgenerator
authorEinar Jørgen Haraldseid <einar.haraldseid@ntnu.no>
Mon, 12 Jun 2017 12:38:25 +0000 (14:38 +0200)
committerEinar Jørgen Haraldseid <einar.haraldseid@ntnu.no>
Mon, 12 Jun 2017 12:38:25 +0000 (14:38 +0200)
middag.sh [new file with mode: 0755]

diff --git a/middag.sh b/middag.sh
new file mode 100755 (executable)
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]}"