Adding easy puzzles

This commit is contained in:
Xavier Morel
2017-04-06 15:55:57 +02:00
parent 2df5dcf1e3
commit 50a3316969
19 changed files with 849 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# https://www.codingame.com/ide/puzzle/the-descent
# Xavier Morel - 2016-03-12
while true; do
mountains=""
for (( i=0; i<8; i++ )); do
# mountainH: represents the height of one mountain, from 9 to 0.
if ((i>0)); then
mountains+=";"
fi
read mountainH
mountains+=$mountainH":"$i
done
echo $mountains | tr ";" "\n" | sort -n | tail -n 1 | cut -d ":" -f 2
done