Thread: Allow the user to click

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    4

    Allow the user to click

    I'm making a tic-tac-toe game for my programming class in C++. I have to allow the user to beable to click one of the squares in the tic-tac-toe board and it should then display a 'X' or a 'O'. I don't know the command or function to allow the user to click the screen. Thanks for any help.

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    This post has a good example of using mice with console windows, if you're using console windows that is. Take a look at it, understand it and modift it for tic tac toe

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    4
    I don't really understand that code. I'm only in inturduction to programming. In my class im using Diane Zak "An Introduction to Programming with C++." Thats all I really know how to use but if any of you have any site that could help me I would also appricieate it. I'm using a win32 console Application.
    Last edited by bulldog224; 05-10-2006 at 09:17 AM.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I'm using a win32 console Application.
    I would suggest you stick with a really simple interface of "enter the number of the square you want to occupy" type interface.

    Learn to program first, then move onto all the snazzy features like using mice, GUIs, graphics, sounds, internet or whatever else interests you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    4
    I have already made a tic-tac-toe program that the user enters the row and column of the square to occupy. Now my teacher wants me to use the mouse to click the square but I have never done anything with the mouse before.

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    Quote Originally Posted by bulldog224
    I have already made a tic-tac-toe program that the user enters the row and column of the square to occupy. Now my teacher wants me to use the mouse to click the square but I have never done anything with the mouse before.
    That's a big step up from just with keys. Is this for a project in school, or just a learning curve assignment thing, or just for the fun of it?

    Have you tried doing it with the arrow keys yet? I know you aren't meant to, but I think it's a bit more realistic a jump from numbers to arrow keys, rather from number to mice.

    There is a very good tutorial on using directional keys here, if you're interested

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Add/Delete Remotely a user
    By Scarvenger in forum Windows Programming
    Replies: 5
    Last Post: 03-24-2008, 08:36 AM
  2. Windows startup - must click user before continuing
    By ulillillia in forum Tech Board
    Replies: 2
    Last Post: 04-30-2007, 03:06 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. ~ User Input script help~
    By indy in forum C Programming
    Replies: 4
    Last Post: 12-02-2003, 06:01 AM
  5. Stopping a user from typeing.
    By knave in forum C++ Programming
    Replies: 4
    Last Post: 09-10-2001, 12:21 PM