aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--README.md6
-rw-r--r--chatbot.c9
-rw-r--r--gtnw.c (renamed from games.c)13
-rw-r--r--gtnw.h (renamed from games.h)0
-rw-r--r--joshua.c13
-rw-r--r--main.cpp3
-rw-r--r--map.h19
-rw-r--r--strings.c1
-rw-r--r--util.c10
10 files changed, 48 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index 8382f75..7028920 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/README.md b/README.md
index 89c9fa0..819053e 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/chatbot.c b/chatbot.c
index 314ae78..ae3e2c6 100644
--- a/chatbot.c
+++ b/chatbot.c
@@ -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... ->
diff --git a/games.c b/gtnw.c
index 108d83f..22b8e23 100644
--- a/games.c
+++ b/gtnw.c
@@ -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)
}
}
}
+
diff --git a/games.h b/gtnw.h
index a0909d0..a0909d0 100644
--- a/games.h
+++ b/gtnw.h
diff --git a/joshua.c b/joshua.c
index 65b2818..3a65de0 100644
--- a/joshua.c
+++ b/joshua.c
@@ -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();
diff --git a/main.cpp b/main.cpp
index b2c31db..d21db5c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,6 +1,7 @@
-#include <iostream>
#include <joshua.h>
+
#include <curses.h>
+#include <iostream>
using namespace std;
int main()
{
diff --git a/map.h b/map.h
index dddaca6..4208788 100644
--- a/map.h
+++ b/map.h
@@ -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"}
+};
diff --git a/strings.c b/strings.c
index e3459e0..1cc22ae 100644
--- a/strings.c
+++ b/strings.c
@@ -1,4 +1,5 @@
#include "strings.h"
+
const char* stage1_triggers[] = {
"im fine",
"im fine how are you",
diff --git a/util.c b/util.c
index a3c336b..2f319f9 100644
--- a/util.c
+++ b/util.c
@@ -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)