Rock Paper Scissors

could somone tell me how i could get this going.

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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <iostream>
#include <ctime>
#include <string>
#include <cstdlib>

using namespace std;

enum Choice{Rock, Paper, Scissors};

Choice getplayerChoice();
Choice getcompChoice();
char Charfromplayer();
bool askPlayagain();


int main()

{
	
	srand(time(0));
	int compWins = 0, myWins = 0, Ties = 0;
	bool playing = true;
	
	while(playing)
	{
	cout << "Lets play rock paper scissors\nr = Rock\np = Paper\ns = Scissors\n";
	Choice player = getplayerChoice();
	Choice comp = getcompChoice();

	if(player == comp)
	{
		cout << "Tie\n";
		Ties ++;
	}
	else if(player == Rock)
	{
		if(comp == Scissors)
		{
			cout << "You Win\n ";
			myWins++;
		}
		else
		{
			cout << "You Loose\n";
			compWins++;
		}
	}
	else if(player == Scissors)
	{
		if(comp == Rock)
		{
			cout << "You Loose\n";
			compWins++;
		}
		else
		{
			cout << "You Win\n";
			myWins++;
		}

	}
	else if(player == Paper)
	{
		if(comp == Rock)
		{
			cout << "You Win\n";
			myWins++;
		}
		else
		{
			cout << "You Loose\n";
			compWins++;
		}
	}
	}

	system("pause");
	return 0;
}
What's the problem? What's wrong with it? What errors are you getting? What incorrect behaviour are you seeing?

We're not psychic.
[code]
1>------ Build started: Project: paperrock, Configuration: Debug Win32 ------
1>Build started 4/24/2013 12:19:34 PM.
1>InitializeBuildStatus:
1> Touching "Debug\paperrock.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>c:\users\mattnsam\documents\visual studio 2010\projects\paperrock\paperrock\main.cpp(20): warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>main.obj : error LNK2019: unresolved external symbol "enum Choice __cdecl getcompChoice(void)" (?getcompChoice@@YA?AW4Choice@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "enum Choice __cdecl getplayerChoice(void)" (?getplayerChoice@@YA?AW4Choice@@XZ) referenced in function _main
1>C:\Users\MattnSam\Documents\Visual Studio 2010\Projects\paperrock\Debug\paperrock.exe : fatal error LNK1120: 2 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.94
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[code/]

those are the errors im getting
Those are linker errors. Whichever files getcompChoice() and getplayerChoice() are defined in aren't being linked into your project.
how would i define them?
Um... you mean, you haven't already? You've written code that's calling those functions, but you've not defined them anywhere? What, were you expecting the compiler to magically read your mind to know what the functions were supposed to do, and create them itself?
Topic archived. No new replies allowed.