From a8e53fff45d7885bf3a8f2d1df47f9b48a2651c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= Date: Mon, 12 Jun 2017 14:38:25 +0200 Subject: [PATCH] Middagsgenerator --- middag.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 middag.sh 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]}" -- 2.30.2