diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-04-04 01:48:43 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-04-04 01:48:43 +1100 |
commit | 19e66dbd8fd3bd66f286bbbcd7ce842d727a4422 (patch) | |
tree | 07f0d484b32c9792a5d18921048243d5ed924873 /command.prolog | |
parent | b2081e26122b3937f04caa62ec864fc343f83ef1 (diff) |
Makefile added, files reorganised
Diffstat (limited to 'command.prolog')
-rw-r--r-- | command.prolog | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/command.prolog b/command.prolog deleted file mode 100644 index f897735..0000000 --- a/command.prolog +++ /dev/null @@ -1,47 +0,0 @@ - - -:- module(command, [getCommand/2]). - - -:- consult('parser.prolog'). - - - - -% functions for parsing a list of words into a recognised command - -getCommand(['quit'],C) :- C =.. [quit]. -getCommand(['exit'],C) :- C =.. [quit]. - - -getCommand(['go',X],C) :- C =.. [move,X]. -getCommand(['move',X],C) :- C =.. [move,X]. - - -getCommand(['n'],C) :- C =.. [move,north]. -getCommand(['north'],C) :- C =.. [move,north]. -getCommand(['s'],C) :- C =.. [move,south]. -getCommand(['south'],C) :- C =.. [move,south]. -getCommand(['e'],C) :- C =.. [move,east]. -getCommand(['east'],C) :- C =.. [move,east]. -getCommand(['w'],C) :- C =.. [move,west]. -getCommand(['west'],C) :- C =.. [move,west]. - - -getCommand(['nw'],C) :- C =.. [move,northwest]. -getCommand(['northwest'],C) :- C =.. [move,northwest]. -getCommand(['ne'],C) :- C =.. [move,northeast]. -getCommand(['northeast'],C) :- C =.. [move,northeast]. -getCommand(['sw'],C) :- C =.. [move,southwest]. -getCommand(['southwest'],C) :- C =.. [move,southwest]. -getCommand(['se'],C) :- C =.. [move,southeast]. -getCommand(['southeast'],C) :- C =.. [move,southeast]. - - -getCommand(['take',X],C) :- C =.. [take,X]. -getCommand(['shoot',X],C) :- C =.. [shoot,X]. - - -getCommand(['l'],C) :- C =.. [look]. -getCommand(['look'],C) :- C =.. [look]. - |