mirror of https://github.com/dirtbags/moth.git
firm up p2 console, add new tank
This commit is contained in:
parent
17e2c6261c
commit
46a0d03cc2
|
@ -10,6 +10,10 @@ fi
|
|||
clear
|
||||
read nonce < $BASE/nonce
|
||||
|
||||
esc () {
|
||||
printf '%s' "$*" | sed 's/[^-0-9A-Za-z ]/_/g; s/ /+/g'
|
||||
}
|
||||
|
||||
newteam () {
|
||||
echo '== Team Creation =='
|
||||
echo
|
||||
|
@ -32,9 +36,18 @@ newteam () {
|
|||
|
||||
printf '%s' "$name" > $BASE/$hash/.name
|
||||
|
||||
echo "Your team hash is $hash. Write that down somewhere and don't lose it."
|
||||
echo "If you forget your hash, you'll have to start over from the beginning"
|
||||
echo "with a new team and everybody will laugh at you."
|
||||
cat <<EOD
|
||||
Your team hash is $hash. Write that down somewhere and don't lose it.
|
||||
If you forget your hash, you'll have to start over from the beginning
|
||||
with a new team and everybody will laugh at you.
|
||||
EOD
|
||||
}
|
||||
|
||||
done () {
|
||||
echo
|
||||
echo "Press [Enter] to clear the screen."
|
||||
read
|
||||
exit 0
|
||||
}
|
||||
|
||||
echo -n 'Team hash ("new" to create a new team): '
|
||||
|
@ -44,21 +57,32 @@ if [ -z "$hash" ]; then
|
|||
exit 0
|
||||
elif [ "$hash" = "new" ]; then
|
||||
newteam
|
||||
done
|
||||
elif ! [ -d $BASE/$hash ]; then
|
||||
echo "No such team, fool."
|
||||
echo "Is this when everybody laughs at you for forgetting your hash?"
|
||||
else
|
||||
read -r name < $BASE/$hash/.name
|
||||
echo "Welcome $name"
|
||||
echo
|
||||
echo "Enter answer and I'll tell you if it's right or if you're a dummy."
|
||||
echo -n '> '
|
||||
read -r answer
|
||||
ahash=$(printf '%s' "$answer" | md5sum | cut -d' ' -f1)
|
||||
done
|
||||
fi
|
||||
|
||||
read -r name < $BASE/$hash/.name
|
||||
echo "Welcome $name"
|
||||
echo
|
||||
echo "Press [Enter] to clear the screen."
|
||||
read
|
||||
exit 0
|
||||
echo "Enter answer and I'll tell you if it's right or if you're a dummy."
|
||||
echo -n '> '
|
||||
read -r answer
|
||||
match=$(awk -v ans="$answer" '(substr($0, length($1)+2) == ans) { print substr(FILENAME, 6, length(FILENAME)-17) " " $1; }' /opt/*/answers.txt)
|
||||
cat=${match% *}
|
||||
points=${match#* }
|
||||
fn=$BASE/$hash/$cat.$points
|
||||
if [ -f $fn ]; then
|
||||
echo "You've already received points for this answer."
|
||||
else
|
||||
printf "%s %s\n" $cat $points > $fn
|
||||
echo "You get $points more points in the $cat category."
|
||||
# run puzzles.cgi
|
||||
# update scoreboard
|
||||
echo "Check the puzzles overview for newly-unlocked content!"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Neale Pickett <neale@lanl.gov>
|
|
@ -0,0 +1 @@
|
|||
#d0d054
|
|
@ -0,0 +1 @@
|
|||
skirts
|
|
@ -0,0 +1,58 @@
|
|||
15 14 set-speed!
|
||||
|
||||
( Front )
|
||||
5 sensor? {
|
||||
get-turret 45 + 90 < { 15 15 } { 2 2 } ifelse set-speed!
|
||||
0 set-turret!
|
||||
} if
|
||||
|
||||
( Rear )
|
||||
6 sensor? {
|
||||
get-turret 45 + 90 < { 2 2 } { -15 -15 } ifelse set-speed!
|
||||
180 set-turret!
|
||||
} if
|
||||
7 sensor? {
|
||||
90 set-turret!
|
||||
5 -5 set-speed!
|
||||
} if
|
||||
8 sensor? {
|
||||
-90 set-turret!
|
||||
-5 5 set-speed!
|
||||
} if
|
||||
|
||||
1 sensor? {
|
||||
get-turret 10 + set-turret!
|
||||
} if
|
||||
|
||||
2 sensor? {
|
||||
get-turret 10 - set-turret!
|
||||
} if
|
||||
|
||||
3 sensor? {
|
||||
get-turret 20 + set-turret!
|
||||
} if
|
||||
|
||||
4 sensor? {
|
||||
get-turret 20 - set-turret!
|
||||
} if
|
||||
|
||||
0 sensor? {
|
||||
0 0 set-speed!
|
||||
get-turret set-turret!
|
||||
fire!
|
||||
} if
|
||||
|
||||
fire-ready? ! {
|
||||
70 60 10 random +
|
||||
get-turret 90 + 180 > { exch } if
|
||||
set-speed!
|
||||
} if
|
||||
|
||||
9 sensor? {
|
||||
5 sensor? {
|
||||
-100 -100
|
||||
} {
|
||||
100 100
|
||||
} ifelse
|
||||
set-speed!
|
||||
} if
|
|
@ -0,0 +1 @@
|
|||
50 0 7 1
|
|
@ -0,0 +1 @@
|
|||
60 10 12 1
|
|
@ -0,0 +1 @@
|
|||
60 -10 12 1
|
|
@ -0,0 +1 @@
|
|||
90 30 40 1
|
|
@ -0,0 +1 @@
|
|||
90 -30 40 1
|
|
@ -0,0 +1 @@
|
|||
60 0 90 0
|
|
@ -0,0 +1 @@
|
|||
60 180 90 0
|
|
@ -0,0 +1 @@
|
|||
80 90 90 0
|
|
@ -0,0 +1 @@
|
|||
80 270 90 0
|
|
@ -0,0 +1 @@
|
|||
30 180 345 0
|
Loading…
Reference in New Issue