GithubHelp home page GithubHelp logo

ia_test's Introduction

  • install swi-prolog and run swipl -l eistein_testing.pl on terminal and run resolve., output:
pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l eistein_testing.pl
Warning: /Users/pedrosampaio/Documents/study/ifma/prolog/eistein_testing.pl:2:
Warning:    set_prolog_stack/2: limit(Size) sets the combined limit.
Warning:    See https://www.swi-prolog.org/changes/stack-limit.html
Warning: /Users/pedrosampaio/Documents/study/ifma/prolog/eistein_testing.pl:3:
Warning:    set_prolog_stack/2: limit(Size) sets the combined limit.
Warning:    See https://www.swi-prolog.org/changes/stack-limit.html
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- resolve
|    .

'1ª House:'
'Color:'yellow
'nationality:'norwegian
'Beer:'water
'Cigarette:'dunhill
'Animal:'cat

'2ª House:'
'Color:'blue
'nationality:'danish
'Beer:'cha
'Cigarette:'blends
'Animal:'horse

'3ª House:'
'Color:'red
'nationality:'englishman
'Beer:'milk
'Cigarette:'pallmall
'Animal:'bird

'4ª House:'
'Color:'green
'nationality:'german
'Beer:'coffee
'Cigarette:'prince
'Animal:'_35656

'5ª House:'
'Color:'white
'nationality:'swedish
'Beer:'beer
'Cigarette:'bluemaster
'Animal:\t'dog
  • install swi-prolog and run swipl -l wumpus.pl on terminal and run init.(init game), output:
pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l wumpus.pl
ERROR: /Users/pedrosampaio/Documents/study/ifma/prolog/wumpus.pl:180:35: Syntax error: Unbalanced operator
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- init.
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).
true.
  • The moves are:
  1. move_up.
  2. move_down.
  3. move_left.
  4. move_right.
  • How win the game:
pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l wumpus.pl
ERROR: /Users/pedrosampaio/Documents/study/ifma/prolog/wumpus.pl:180:35: Syntax error: Unbalanced operator
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l wumpus.pl
ERROR: /Users/pedrosampaio/Documents/study/ifma/prolog/wumpus.pl:180:35: Syntax error: Unbalanced operator
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- init.
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).
true.

?- move_right.
'Move Right'
Your new position: (X:2, Y:1).
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:3, Y:1).
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:4, Y:1).
Did you smell some horrible smell in here!!!!
You find gold, go back to starting position and win the game!!!
Now you have it 100 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:5, Y:1).
Now you have it 100 units of gold.
false.

?- move_right.
'Move Right'
You hit a wall!
true.

?- move_down.
'Move Down'
Your new position: (X:5, Y:2).
Did you smell some horrible smell in here!!!!
Now you have it 100 units of gold.
false.

?- move_down.
'Move Down'
Your new position: (X:5, Y:3).
Now you have it 100 units of gold.
false.

?- move_left.
'Move Left'
Your new position: (X:4, Y:3).
Did you smell some horrible smell in here!!!!
You felt a breeze here!!!!
Now you have it 100 units of gold.
false.

?- move_left.
'Move Left'
Your new position: (X:3, Y:3).
You find gold, go back to starting position and win the game!!!
Now you have it 200 units of gold.
false.

?- move_up.
'Move Up'
Your new position: (X:3, Y:2).
Did you smell some horrible smell in here!!!!
Now you have it 200 units of gold.
false.

?- move_up.
'Move Up'
Your new position: (X:3, Y:1).
Now you have it 200 units of gold.
false.

?- move_up.
'Move Up'
You hit a wall!
true.

?- move_left.
'Move Left'
Your new position: (X:2, Y:1).
Now you have it 200 units of gold.
false.

?- move_left.
'Move Left'
Your new position: (X:1, Y:1).
Now you have it 200 units of gold.
You Win!!!
  • How to lose swallowed by wumpus:
pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l wumpus.pl
ERROR: /Users/pedrosampaio/Documents/study/ifma/prolog/wumpus.pl:180:35: Syntax error: Unbalanced operator
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- init.
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).
true.

?- move_right.
'Move Right'
Your new position: (X:2, Y:1).
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:3, Y:1).
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:4, Y:1).
Did you smell some horrible smell in here!!!!
You find gold, go back to starting position and win the game!!!
Now you have it 100 units of gold.
false.

?- move_down.
'Move Down'
Your new position: (X:4, Y:2).
Wumpus killed you. :/
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).
  • How to lose falling into the abyss
pedrosampaio@MacBook-Pro-de-Pedro prolog % swipl -l wumpus.pl
ERROR: /Users/pedrosampaio/Documents/study/ifma/prolog/wumpus.pl:180:35: Syntax error: Unbalanced operator
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- init.
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).
true.

?- move_down.
'Move Down'
Your new position: (X:1, Y:2).
Now you have it 0 units of gold.
false.

?- move_down.
'Move Down'
Your new position: (X:1, Y:3).
Now you have it 0 units of gold.
false.

?- move_down.
'Move Down'
Your new position: (X:1, Y:4).
Now you have it 0 units of gold.
false.

?- move_right
|    .
'Move Right'
Your new position: (X:2, Y:4).
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:3, Y:4).
You felt a breeze here!!!!
Now you have it 0 units of gold.
false.

?- move_right.
'Move Right'
Your new position: (X:4, Y:4).
You fell into an abyss and died. :/
'Welcome to Mundo de Wumpus/World of Wumpus'

'Your goal is to find gold and return alive to the entrance'

'Your movements are: move_up; move_left; move_down; move_right;'Your new position: (X:1, Y:1).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.