prolog-examples icon indicating copy to clipboard operation
prolog-examples copied to clipboard

Tutorial on using Tictactoe

Open ridhof opened this issue 5 years ago • 12 comments

Hi, my name is Ridho. I want to promote tictactoe using prolog in my class but I know nothing about prolog and about your code. Could anyone help me on what is the first step on running this program till the game end? Thank you in advance.

ridhof avatar Oct 22 '18 11:10 ridhof

Hi ridho - I just collect the examples, so don't know this code. That said, to start the game: swipl tictactoe.pl ?- tictactoe. Looks like you type in coordinates to play.

  From: Ridho Febriansa <[email protected]>

To: Anniepoo/prolog-examples [email protected] Cc: Subscribed [email protected] Sent: Monday, October 22, 2018 4:27 AM Subject: [Anniepoo/prolog-examples] Tutorial on using Tictactoe (#7)

Hi, my name is Ridho. I want to promote tictactoe using prolog in my class but I know nothing about prolog and about your code. Could anyone help me on what is the first step on running this program till the game end? Thank you in advance.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Anniepoo avatar Oct 22 '18 20:10 Anniepoo

wow thanks! Finally I can run the game but after type 'tictactoe.' I don't know how play like playing my turn or enemy turn. Can you help me?

ridhof avatar Oct 23 '18 07:10 ridhof

Here's the relevant code

| moveUser(Board , NewBoard) :- showBoard(Board), put('*'),get_char(Y), get_char(_), name(Y , [X]), | |

Loc is X - 48, !,procUserMove(Loc,Board,NewBoard). type in 0 thru 9 to play in that spot.

  From: Ridho Febriansa <[email protected]>

To: Anniepoo/prolog-examples [email protected] Cc: Anne Ogborn [email protected]; Comment [email protected] Sent: Tuesday, October 23, 2018 12:33 AM Subject: Re: [Anniepoo/prolog-examples] Tutorial on using Tictactoe (#7)

wow thanks! Finally I can run the game but after type 'tictactoe.' I don't know how play like playing my turn or enemy turn. Can you help me?— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Anniepoo avatar Oct 23 '18 18:10 Anniepoo

Hi, this collection is very useful for a beginner like me. Thank you. I too tried ticktactoe and it seems like there are a few bugs. Can I send you the file if I am able to fix some of them?

vjktm avatar Aug 28 '22 04:08 vjktm

Just PR it

Anniepoo avatar Aug 28 '22 15:08 Anniepoo

Instructions for playing - the spaces are numbered 0-9
type ?- tictactoe. to start type a number 0 thru 9 and a newline.
Then youll see the board again and repeat unti someone wins.

Anniepoo avatar Aug 28 '22 16:08 Anniepoo

Just PR it This is new to me. I forked and created the following: https://github.com/vjktm/prolog-examples/pull/1#issue-1356544904

The change is in my fork. What should I do next?

vjktm avatar Oct 04 '22 04:10 vjktm

Fix the issue.

Go to your fork, and on the home page, with code | Issues | Pull Requests| Actions ...

choose Pull Requests and leave the request setting -  describe your fix, and submit it I'll come along and accept it

   Just PR it This is new to me. I forked and created the following: vjktm#1 (comment)

The change is in my fork. What should I do next?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Anniepoo avatar Oct 17 '22 01:10 Anniepoo

Hi Annie, thanks for the guidance. There is one pull request in viktm/prolog-examples. Heading is "Minor fixes to tic-tac-toe. Can you see it? Should I do anything else? E.g., assign to you? Thanks for the help.

vjktm avatar Nov 03 '22 23:11 vjktm

weirdly, no, I don't see your PR  -

Shows as no PR's open.

On Friday, November 4, 2022 at 12:01:08 AM GMT+1, Vp @.***> wrote:

Hi Annie, thanks for the guidance. There is one pull request in viktm/prolog-examples. Heading is "Minor fixes to tic-tac-toe. Can you see it? Should I do anything else? E.g., assign to you? Thanks for the help.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Anniepoo avatar Nov 04 '22 09:11 Anniepoo

See the issue - you filed the PR against yourself.  Fie it against anniepoo/prolog-examples.  YOU want ME to merge YOUR code. what you did is YOU want YOU to merge YOUR code.

On Friday, November 4, 2022 at 12:01:08 AM GMT+1, Vp @.***> wrote:

Hi Annie, thanks for the guidance. There is one pull request in viktm/prolog-examples. Heading is "Minor fixes to tic-tac-toe. Can you see it? Should I do anything else? E.g., assign to you? Thanks for the help.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Anniepoo avatar Nov 04 '22 09:11 Anniepoo

:-( I think I set it up correctly now.

vjktm avatar Nov 04 '22 13:11 vjktm