Running code in the background

This is a discussion on Running code in the background within the C++ Programming forums, part of the General Programming Boards category; So, I want to program a card playing engine**, but the engine needs to be able to calculate while it's ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    8

    Running code in the background

    So, I want to program a card playing engine**, but the engine needs to be able to calculate while it's the opponent's turn (so it makes moves quicker and for other obvious reasons). Meaning there has to be a certain block of code that's always running, unfortunately I don't know how to do that. Ideas and help would be appreciated.

    ** It should play Thirteen when completed (A variation of Tien Len )

    --Random

  2. #2
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    Multi threading

    Look up some multi threading tutorials. I do not have any online tutorials on multithreading, sorry.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,074
    Here's the thing...
    I don't know the specific card game you're talking about, but I'd be willing to bet that it's nothing so complicated that a computer couldn't compute it's next move in an immesurable amount of time. Computers can process thousands of possibilities in under a second.

    If you really wanted to have it think while you're playing, though. windows.h has functions that can process stuff while it's waiting for a signal from the keyboard.
    Sent from my iPadŽ

  4. #4
    Never Exist Hermitsky's Avatar
    Join Date
    Jul 2004
    Posts
    149
    try search "_beginthread()" on MSDN

    blow me ... ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. running code in borland
    By Aisthesis in forum Tech Board
    Replies: 5
    Last Post: 05-19-2009, 12:06 AM
  2. Running my program in the background
    By shoobsie in forum Windows Programming
    Replies: 4
    Last Post: 10-09-2005, 02:38 AM
  3. Running hidden executables in background
    By Fender Bender in forum Windows Programming
    Replies: 15
    Last Post: 04-17-2005, 10:59 AM
  4. multithreading question
    By ichijoji in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2005, 10:59 PM
  5. Running program on background?
    By Couhilin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2001, 06:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21