diff options
| author | Franklin Wei <franklin@fwei.tk> | 2014-06-27 18:11:06 -0400 |
|---|---|---|
| committer | Franklin Wei <franklin@fwei.tk> | 2014-06-27 18:11:06 -0400 |
| commit | aedf71494b2011ceeb06b96e63da1c7a79a32e0e (patch) | |
| tree | a74e1584445d33fec8210141f72c8f33e1e027e5 | |
| parent | ba1e1deb1bdca110051aa83dec1c03e8b2a02209 (diff) | |
| download | wargames-server-aedf71494b2011ceeb06b96e63da1c7a79a32e0e.zip wargames-server-aedf71494b2011ceeb06b96e63da1c7a79a32e0e.tar.gz wargames-server-aedf71494b2011ceeb06b96e63da1c7a79a32e0e.tar.bz2 wargames-server-aedf71494b2011ceeb06b96e63da1c7a79a32e0e.tar.xz | |
Restructure
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | chatbot.c | 9 | ||||
| -rw-r--r-- | gtnw.c (renamed from games.c) | 13 | ||||
| -rw-r--r-- | gtnw.h (renamed from games.h) | 0 | ||||
| -rw-r--r-- | joshua.c | 13 | ||||
| -rw-r--r-- | main.cpp | 3 | ||||
| -rw-r--r-- | map.h | 19 | ||||
| -rw-r--r-- | strings.c | 1 | ||||
| -rw-r--r-- | util.c | 10 |
10 files changed, 48 insertions, 30 deletions
@@ -1,5 +1,5 @@ -SOURCES=joshua.o main.o util.o chatbot.o games.o strings.o -HEADERS=chatbot.h games.h joshua.h location.h strings.h map.h util.h +SOURCES=joshua.o main.o util.o chatbot.o gtnw.o strings.o +HEADERS=chatbot.h gtnw.h joshua.h location.h strings.h map.h util.h CXXFLAGS=-I. -lncurses -g -O3 CFLAGS=-I. -std=gnu99 -g -O3 wargames: $(SOURCES) $(HEADERS) @@ -1,8 +1,4 @@ ==WarGames== Program to simulate the W.O.P.R. from WarGames, with WORKING Global Thermonuclear War! -For the uninitiated, the logon is "joshua" -Say hi, and that you are fine. -Then, say "love to" when Joshua asks to play a game -Then, type "later" -Then, enjoy the ASCII masterpiece!
\ No newline at end of file +For the uninitiated, read the TRANSCRIPT file @@ -1,10 +1,11 @@ -#include <curses.h> -#include <util.h> +#include "gtnw.h" #include "strings.h" -#include <games.h> +#include "util.h" + +#include <curses.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> -#include <stdlib.h> void do_chatbot(void) { int stage=0; /* stage 0: i'm fine how are you... -> @@ -1,11 +1,11 @@ -#include <games.h> +#include "gtnw.h" +#include "location.h" +#include "map.h" +#include "util.h" #include <curses.h> -#include <map.h> -#include <util.h> -#include <location.h> -#include <unistd.h> -#include <string.h> #include <stdlib.h> +#include <string.h> +#include <unistd.h> static bool surrender=false; static int winner=0; /* on surrender */ static unsigned int max(long long a, long long b) @@ -379,3 +379,4 @@ void global_thermonuclear_war(void) } } } + @@ -1,12 +1,13 @@ -#include <joshua.h> -#include <chatbot.h> +#include "chatbot.h" +#include "joshua.h" +#include "strings.h" /* predefined strings */ +#include "util.h" + #include <curses.h> -#include <stdlib.h> -#include <util.h> #include <signal.h> -#include <unistd.h> +#include <stdlib.h> #include <string.h> -#include "strings.h" +#include <unistd.h> void cleanup(int signum) { endwin(); @@ -1,6 +1,7 @@ -#include <iostream> #include <joshua.h> + #include <curses.h> +#include <iostream> using namespace std; int main() { @@ -1,4 +1,3 @@ -#define LITERAL(x) (char[]){x} char *map[] = { /* 0 */ (char[]){" ."}, /* 1 */ (char[]){" __________--^-^-\\. ____ __----/^\\."}, @@ -16,4 +15,20 @@ char *map[] = { /* 13 */ (char[]){""}, /* 14 */ (char[]){" UNITED STATES SOVIET UNION"} }; - +const char *const_map[] = { + /* 0 */ (char[]){" ."}, + /* 1 */ (char[]){" __________--^-^-\\. ____ __----/^\\."}, + /* 2 */ (char[]){"|\\/. \\__. ___/ || ___/ _/._-_ ."}, + /* 3 */ (char[]){"| \\. /. /. __ __/ /__/ \\/^^\\___-__."}, + /* 4 */ (char[]){"| L-^-/. /. \\.\\_-- \\."}, + /* 5 */ (char[]){"| / _/ _/\\/."}, + /* 6 */ (char[]){"|. | _/. __ __/"}, + /* 7 */ (char[]){" \\. /. / ___/.//"}, + /* 8 */ (char[]){" \\__ / | / \\/."}, + /* 9 */ (char[]){" \\________ __ _____.\\. \\_. ____--_ /\\_ \\"}, + /* 10 */ (char[]){" \\__. / V. \\ \\ \\__ _/. \\_/ //"}, + /* 11 */ (char[]){" \\ /. \\/. \\. _/. //"}, + /* 12 */ (char[]){" \\_/. \\_/"}, + /* 13 */ (char[]){""}, + /* 14 */ (char[]){" UNITED STATES SOVIET UNION"} +}; @@ -1,4 +1,5 @@ #include "strings.h" + const char* stage1_triggers[] = { "im fine", "im fine how are you", @@ -1,9 +1,11 @@ -#include <util.h> +#include "strings.h" +#include "util.h" + #include <ctype.h> -#include <unistd.h> -#include <string.h> #include <curses.h> -#include "strings.h" +#include <string.h> +#include <unistd.h> + void allLower(char* str) { for(int i=0;str[i];++i) |