C :: Tictactoe X And O Locations

Jan 26, 2013

I've made a tictactoe game using ncurses functions such as mvaddch to put x and o on my board. I need to somehow find the locations of the x's and o's so that i can win my game.

View 10 Replies


ADVERTISEMENT

C :: Write At Random Memory Locations

Jan 29, 2014

I have a complex program, around 25.000 code lines. It is quite stable, but I have a bug which only happens from time to time, and when in online-mode, so it is quite difficult for me to reproduce it. I have put lot of efforts to see where the problem is, and I have seen where the code crash, but that line is not the culprit, it only refers to read a memory location where it is supposed to be good data, and it is not. The real bug has happens before in execution. That data is read-only, I mean, I only compute it at program start-up, and then never write into it again, but my bug write to it doring code run, maybe because bad pointers address in any place, and look ramdom (different snapshots execution write at different memory locations).

My question is, is there a way to know when my code 'write' into that 'to me protected memory'? I thinking if there is a method to make a hash of all variables and arrays in that memory section, or any way to 'assert' when that big memory section is written, taking into accound that when I refer to that memory section it could be any of the lots of variables and arrays I precompute at start-up.

View 2 Replies View Related

C :: Locations In The RAM Addressed Per Word Or Per Byte?

Sep 20, 2014

Are locations in the RAM addressed per word or per byte? I am using a 32 bit machine, so I think that it means that on my PC a word would be 4 bytes.

View 11 Replies View Related

C++ :: TicTacToe With Classes - Getting Runtime Errors

Feb 17, 2013

I have this TicTacToe program that needs finishing. All the code is finished, but I'm getting runtime errors. It is printing out junk values from my array when they should be empty.

//Player.h
#include <string>
#include "TTT.h"
using namespace std;
class Player {

[Code] .....

//This is a screenshot of the output. [URL] .....

View 5 Replies View Related

C/C++ :: TicTacToe Board Won't Update - Prints Twice

Feb 22, 2015

Im trying to make a Tic Tac Toe board for an assignment. Right now it compiles fine but when I enter an x or o it does not update the board it just prints out the '.'s that the board is initialized to. Also, when I get to player 2 the board will printout twice so its 6 rows or 3 columns. The project uses a main to ask who starts then goes to a play function that asks for inputs and calls the makeMove function to place the x's and o's and the print function to display the updated board.

bool Board::makeMove(int rowIn, int columnIn, char currentPlayer) {
if (playBoard[rowIn][columnIn] == '.') {
playBoard[rowIn][columnIn] = currentPlayer;
return true;

[Code] ....

View 14 Replies View Related

C :: Boolean Value Cross-functional In Game TicTacToe

Dec 11, 2014

Why something doesn't work without setting global variables. I want to know how to deliver values for example my boolean value "ende" (means end) from the function in line 99

Code:
bool pruefeGewinn() or in line 116 Code: bool spielfeldVoll() to the main function for using it there for Code: } while (ende != true); in line 164.

How to return it correctly?

Here is the Code of the game TicTacToe.

Code:
#include <stdio.h> // In- and Output
#include <stdlib.h> // Implementation of many functions
#include <stdbool.h> // Allows in C99 True and False as Boolean
#include <time.h> // Allows using Random by time

/*----------------------- Constants -------------------------*/

#define KANTENLAENGE 3
#define STRING 100

[Code] .....

View 6 Replies View Related

C++ :: Resetting Board On TicTacToe In Order To Play Again

May 25, 2014

How to reset the board in order to play again without spots already taken.

#include <iostream>
#include<cstdlib>
#include<ctime>
using namespace std;

char location[10] = {'0','1','2','3','4','5','6','7','8','9'};
int displayMenu(int &player, int &win);

[Code] .....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved