firm up p2 console, add new tank

This commit is contained in:
Neale Pickett 2012-05-24 15:16:19 -06:00
parent c008649609
commit b6ec9faae3
15 changed files with 109 additions and 14 deletions

View File

@ -10,6 +10,10 @@ fi
clear clear
read nonce < $BASE/nonce read nonce < $BASE/nonce
esc () {
printf '%s' "$*" | sed 's/[^-0-9A-Za-z ]/_/g; s/ /+/g'
}
newteam () { newteam () {
echo '== Team Creation ==' echo '== Team Creation =='
echo echo
@ -32,9 +36,18 @@ newteam () {
printf '%s' "$name" > $BASE/$hash/.name printf '%s' "$name" > $BASE/$hash/.name
echo "Your team hash is $hash. Write that down somewhere and don't lose it." cat <<EOD
echo "If you forget your hash, you'll have to start over from the beginning" Your team hash is $hash. Write that down somewhere and don't lose it.
echo "with a new team and everybody will laugh at you." 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): ' echo -n 'Team hash ("new" to create a new team): '
@ -44,21 +57,32 @@ if [ -z "$hash" ]; then
exit 0 exit 0
elif [ "$hash" = "new" ]; then elif [ "$hash" = "new" ]; then
newteam newteam
done
elif ! [ -d $BASE/$hash ]; then elif ! [ -d $BASE/$hash ]; then
echo "No such team, fool." echo "No such team, fool."
echo "Is this when everybody laughs at you for forgetting your hash?" echo "Is this when everybody laughs at you for forgetting your hash?"
else done
fi
read -r name < $BASE/$hash/.name read -r name < $BASE/$hash/.name
echo "Welcome $name" echo "Welcome $name"
echo echo
echo "Enter answer and I'll tell you if it's right or if you're a dummy." echo "Enter answer and I'll tell you if it's right or if you're a dummy."
echo -n '> ' echo -n '> '
read -r answer read -r answer
ahash=$(printf '%s' "$answer" | md5sum | cut -d' ' -f1) 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 fi
echo done
echo "Press [Enter] to clear the screen."
read
exit 0

View File

@ -0,0 +1 @@
Neale Pickett <neale@lanl.gov>

View File

@ -0,0 +1 @@
#d0d054

View File

@ -0,0 +1 @@
skirts

View File

@ -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

View File

@ -0,0 +1 @@
50 0 7 1

View File

@ -0,0 +1 @@
60 10 12 1

View File

@ -0,0 +1 @@
60 -10 12 1

View File

@ -0,0 +1 @@
90 30 40 1

View File

@ -0,0 +1 @@
90 -30 40 1

View File

@ -0,0 +1 @@
60 0 90 0

View File

@ -0,0 +1 @@
60 180 90 0

View File

@ -0,0 +1 @@
80 90 90 0

View File

@ -0,0 +1 @@
80 270 90 0

View File

@ -0,0 +1 @@
30 180 345 0