Anniepoo / prolog-examples

Some simple examples for new Prolog programmers
570 stars 177 forks source link

Tutorial on using Tictactoe #7

Open ridhof opened 5 years ago

ridhof commented 5 years ago

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.

Anniepoo commented 5 years ago

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 <notifications@github.com>

To: Anniepoo/prolog-examples prolog-examples@noreply.github.com Cc: Subscribed subscribed@noreply.github.com 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.

ridhof commented 5 years ago

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?

Anniepoo commented 5 years ago

Here's the relevant code

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

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

  From: Ridho Febriansa <notifications@github.com>

To: Anniepoo/prolog-examples prolog-examples@noreply.github.com Cc: Anne Ogborn annie66us@yahoo.com; Comment comment@noreply.github.com 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.

vjktm commented 2 years ago

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?

Anniepoo commented 2 years ago

Just PR it

Anniepoo commented 2 years ago

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.

vjktm commented 1 year ago

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?

Anniepoo commented 1 year ago

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: @.***>

vjktm commented 1 year ago

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.

Anniepoo commented 1 year ago

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 commented 1 year ago

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: @.***>

vjktm commented 1 year ago

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