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 7938627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:51:42+00:00 2026-06-03T22:51:42+00:00

Well, as the title suggests, I am coding a game which is called Morabaraba.

  • 0

Well, as the title suggests, I am coding a game which is called Morabaraba. It will be a computer vs human game. I will use game trees and alpha-beta cut-offs in order to generate the computer plays and every computer play should be made in a specific amount of time (let’s say 15 seconds).

What is the best way to count the elapsed seconds since the begin of its turn and validate that it still has not exceeded the time limit without overloading the system? As is known, time is precious when generating game trees. Exceeding time limit will result in forfeit.

I want to know how this could be done with lightweight algorithm. How can I validate that time limit has not been reached every x seconds? Is the time of this validation negligible?

Thanks in advance.

  • 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-06-03T22:51:44+00:00Added an answer on June 3, 2026 at 10:51 pm

    Yes, time of this validation will be mostly negligible just because you will poll the amount of time passed at discrete intervals and compare it to the start time to know how much time is elapsed so far.

    I see two solutions here:

    • embed the time check in the same thread that is computing the alpha-beta pruning and stop it accordingly returning the best solution found so far
    • place the AI code on a separate thread and interrupt it when time went over a threshold, by ensuring that the best solution so far is already stored somewhere so that you can pick it up

    Second approach may sound scary but in certain situations it’s just unpractical to check elapsed time within the algorithm itself because the code cannot be easily adapted and interrupted from the callee (for example if you have a non modular algorithm made of many different steps, which is not your case though)

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

Sidebar

Related Questions

As the title suggests, I've inherited a php/MySQL application which has fairly well written
Well, question is in title. Is it possible at all? I can use css
Well, as the title suggests: I have a storyboard and I want it's animation
I'm trying to figure out which type of seo i will use for my
Well the title explains pretty much everything. I want to use something like p
Well the title is quite self explanatory. I want to build two panels one
Well the title pretty much sums the question. The only thing I found is
The title explains it pretty well, but I'm trying to build a 'for loop'
My title sums this up pretty well. My first though it to provide a
Well, title self describes it.. I need to run a sql function to clean

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.