Beginner game ideas

Pages: 12
closed account (jwkNwA7f)
Tic Tac Toe game finished. Now working on hangman.
I just started Tic Tac Toe in SDL.
closed account (jwkNwA7f)
I just did it in a simple array. I am not that advanced yet.

I am learning to do that tho XD
Yeah. You will get there if you stick with it. I am probably not entirely ready to use SDL but as of right now I know everything to make a simple Tic Tac Toe game. I know programming methodology up to inheritance.
closed account (jwkNwA7f)
I will try my best.
I have been reading this: http://lazyfoo.net/SDL_tutorials/index.php

I am also learning WinAPI so I can make more advanced applications too.
closed account (jwkNwA7f)
I ran into a problem making the hangman game.

When I do this:
1
2
3
4
5
6
        wordanswer[0] = wordlist[randword];
	wordtotal[0] = guessingword[0] + guessingword[1] + guessingword[2] + guessingword[3];
	if (strcmp (wordtotal[0], wordanswer[0]) == 0)
	{
		won = true;
	}


It has an error and I can't figure it out.

Thank you!
closed account (Dy7SLyTq)
are you using std::string? it doesnt use strcmp. it just uses ==
closed account (jwkNwA7f)
No, I am using char.
closed account (jwkNwA7f)
It says
error: argument type of "char" is incompatible with parameter of type "const char"
forwordtotal[0] and wordanswer[0].
closed account (Dy7SLyTq)
could you show all of your code?
closed account (jwkNwA7f)
Yah, just give me a second.
closed account (jwkNwA7f)
I am still working on it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <string>
#include <iostream>
#include <Windows.h>
#include <cstring>
using namespace std;

int hangprocessnum = 1;
int guessesleft = 7;
int randword = rand() % 9;

char guessingword[4] = {'_', '_', '_', '_'};
char list[7] = {'_', '_','_','_','_','_','_'};
char guesschar;
char wordlist[10] = {'past', 'word', 'dogs', 'goat', 'done', 'game', 'book', 'like', 'ball', 'fast'};
char wordanswer[1];
char wordtotal[1];

bool lost = false;
bool won = false;

int _tmain();
void draw(int hpn);
void guess();
void guess()
{
	wordanswer[0] = wordlist[randword];
	wordtotal[0] = guessingword[0] + guessingword[1] + guessingword[2] + guessingword[3];
	if (strcmp (wordtotal[0], wordanswer[0]) == 0)
	{
		won = true;
	}
	draw(hangprocessnum);
	for (int i = 0; i <= 7; i++)
	{
		cout << list[i] << " ";
	}
	cout << endl;
	cout << "Guesses left: " << guessesleft;
	cout << endl;
	cout << "Word: ";
	for (int n = 0; n <= 4; n++)
	{
		cout << guessingword[n];
	}
	cout << endl;
	cout << "Guess a letter >> ";
	cin >> guesschar;
	cin.get();
	guessesleft--;
	guess();
}

void draw(int hpn)
{
	...
}

int _tmain()
{
	guess();
	cin.get();
	return 0;
}
closed account (jwkNwA7f)
Nevermind, I fixed it.

I didn't need the[0] on them.
Topic archived. No new replies allowed.
Pages: 12