Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:40:32+00:00 2026-05-13T17:40:32+00:00

I am implementing Othello game in Prolog. The game board is represented as list

  • 0

I am implementing Othello game in Prolog. The game board is represented as list of lists.

I am facing a problem with flipping pieces after making a move.

My strategy is to look in all 8 directions from position where I placed my piece (say black),

and find the enclosing black piece and flip every white piece between my pieces.

So, I have 8 separate predicates to do that.

The problem is I call them sequentially after I make a move, and if any one of these predicates fails, the whole thing fails.

Is there any way to get around this? Or maybe my approach is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:40:32+00:00Added an answer on May 13, 2026 at 5:40 pm

    As suggested by Cari Norum I just make my predicates never fail. So if one fails, I just make it return the current board state. That seems to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Implementing Document-View pattern I faced the problem: standard generic collections and dictionaries ( List<T>
implementing code for customized mini(less squares, less pieces ) chess board in java or
Im implementing a pool billiard game in Java and it all works fine. It
When implementing move constructors and move assignment operators, one often writes code like this:
Currently I'm working on an Othello/Reversi game in c++. I have it finished except
Implementing org.jscep.server.ScepServlet I need to provide an implementation for the method doEnroll ( List<X509Certificate>
After implementing the data structure suggested in this thread , I decided to fill
Implementing a custom Dependency Property on a Framework Element object causes my Visual Studio
Implementing the ScriptControlClass was extremely easy, unfortunately the side effects with the language implementation
implementing publishActivity in PHP using the REST API using this code: $activity = array(

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.