From 7281c95860a5c9e6d3f445b5a884c4d07d56dc77 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 23 Jun 2014 18:23:58 +0000 Subject: more bugfixes.. --- Makefile | 11 ++++++----- joshua.c | 15 ++++++++++++++- strings.c | 14 ++++++++++++-- strings.h | 1 + util.h | 2 +- 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index f41cff6..8382f75 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ 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 -CXXFLAGS=-I. -lncurses -g -CFLAGS=-I. -std=gnu99 -g -all: $(SOURCES) $(HEADERS) - g++ $(SOURCES) -lncurses +CXXFLAGS=-I. -lncurses -g -O3 +CFLAGS=-I. -std=gnu99 -g -O3 +wargames: $(SOURCES) $(HEADERS) + g++ $(SOURCES) $(CXXFLAGS) -lncurses -o wargames +all: wargames Makefile clean: - rm -f $(SOURCES) a.out *~ + rm -f $(SOURCES) a.out wargames *~ diff --git a/joshua.c b/joshua.c index fb7190c..33fceb8 100644 --- a/joshua.c +++ b/joshua.c @@ -6,6 +6,7 @@ #include #include #include +#include "strings.h" void cleanup(int signum) { endwin(); @@ -70,7 +71,19 @@ void be_joshua() usleep(SLEEP_TIME*100); print_string("GREETINGS, PROFESSOR FALKEN.\n\n"); refresh(); - getnstr(buf, 32); /* ignore this */ + getnstr(buf, 32); + allLower(buf); + remove_punct(buf); + for(int i=0;i