aboutsummaryrefslogtreecommitdiff
path: root/gtnw.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@fwei.tk>2014-06-28 10:24:09 -0400
committerFranklin Wei <franklin@fwei.tk>2014-06-28 10:24:09 -0400
commit645a27fa9d7c7d8a4f9131c032da468386fed116 (patch)
tree5ce9e7d3b82f85fe74b61639a9131514f967c812 /gtnw.c
parent4f96334063ecb30435f04b0c19e752498602d27f (diff)
downloadwargames-server-645a27fa9d7c7d8a4f9131c032da468386fed116.zip
wargames-server-645a27fa9d7c7d8a4f9131c032da468386fed116.tar.gz
wargames-server-645a27fa9d7c7d8a4f9131c032da468386fed116.tar.bz2
wargames-server-645a27fa9d7c7d8a4f9131c032da468386fed116.tar.xz
Licensed code under GPL3, map under CC-BY-SA-4.0
Diffstat (limited to 'gtnw.c')
-rw-r--r--gtnw.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/gtnw.c b/gtnw.c
index 1be73a0..f86766c 100644
--- a/gtnw.c
+++ b/gtnw.c
@@ -1,3 +1,23 @@
+/*
+ * WarGames - a WOPR emulator written in C
+ * Copyright (C) 2014 Franklin Wei
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Contact the author at contact@fwei.tk
+ */
+
#include "gtnw.h"
#include "location.h"
#include "map.h"
@@ -7,12 +27,15 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+
static bool surrender=false;
static int winner=0; /* on surrender */
+
static unsigned int max(long long a, long long b)
{
return a>b?a:b;
}
+
/* simulate a missile launch */
static void fire_missile(struct location_t* city)
{
@@ -395,5 +418,3 @@ void global_thermonuclear_war(void)
}
}
}
-
-