I am a beginning C++ Coder and have worked on very basic projects.
I have been teaching myself with the internet for about 3 months. None of which I have published.
When my uncle(doesn't have any knowledge of code) had come over and wasn't impressed at all. I was pretty disappointed. So I set out to impress him.
So I decided to make a game and it devolved into 2.
I've showed my games to my family, but I want a larger opinion on them.
Below is a link to a weebly website with download links for my games. Any opinions are welcomed, but keep in mind I am a beginner and this is in no way to supposed to be better then a game like GTA V.
You posted this on a C++ forum, but have linked us two binaries, the review of which does not require C++ coding expertise.
Programmers tend to treat binaries with some suspicion, mostly because there's no simple way to be sure what they do ahead of time without decompiling them, and reviewing decompiled code is, putting it mildly, not fun.
Additionally, that you've provided us with binaries for Windows alone makes it harder for anyone not on Windows to give any meaningful review*. It's possible that you rely on cross-platform libraries such that your code could compile on other platforms, but we don't know that. Even if you do rely on Windows-specific libraries or functionality, some people might still be able to offer input just based on the gameplay code.
If you want our opinion, it's probably in your best interest to share the source code with us, even if you're not specifically looking for a code review. At the very least, it would help with peace of mind that you're not distributing anything malicious. Otherwise, this thread may be better suited to the Lounge (which, you can move it there by clicking the Edit Topic button at the top).
Happy coding!
-Albatross
*Ignoring the fact that WINE and virtualization exist for a moment here.
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
usingnamespace std;
int main(){
string aa;
string cc;
string dd;
int a;
int b;
int c=100;
int d;
int z;
for(string bb="yes";bb=="yes";){
cout<<"Welcome to DICE INFINITE!\n";
cout<<"Same Old DICE...\n";
cout<<"BUT It's Infinite(Obviously)!!\n";
cout<<"This is a Game of Chance!\n";
cout<<"You Start With 100 Creidts!\n";
cout<<"Choose a Number 1-6!\n";
cout<<"If You Guess Correctly You Gain 40 Credits!\n";
cout<<"If You Guess Incorrectly You Lose 10 Credits!\n";
cout<<"Type 99 to End Game At Any Time!\n";
cout<<"The Cheat Code Is Your Choice!!\n";
cout<<"Please Enter Your Name!\n";
cout<<"Name:";
cin>>aa;
cout<<"Cheat Code(Numbers Only): ";
cin>>z;
for(int cred=100;cred>0;){
srand(time(0));
b=1+(rand()%6);
cout<<"\n";
cout<<aa;
cout<<" Chooses ";
cin>>d;
if(d==99){
cred=0;
}
else{
if(d==z){
cout<<"Cheat Code Accepted!\n";
cout<<"50 Credits Added!\n";
cred=cred+50;
}
else{
if(d--==b){
cout<"The Answer is: ";
cout<<b;
cout<<"\n";
cout<<"You Win!\n\n";
cred=cred+40;
}
else{
cout<<"The Correct Answer is:";
cout<<b;
cout<<"\n";
cout<<"You Lost!\n";
cout<<"Try Again!\n";
cred=cred-10;
}
}
}
cout<<"You Have ";
cout<<cred;
cout<<" Credits\n";
if(cred<1){
cout<<"Sorry You Ran Out of Credits!\n";
cout<<"Play Again?\n";
cin>>bb;
}
}
}
system("pause");
return 0;
}
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
usingnamespace std;
int main(){
string name;
int cheat;
string chi;
for(string z="yes";z=="yes";){
cout<<"Do You Know the Cheat Code? V 0.3\n";
cin>>chi;
if(chi=="yes"){
cout<<"What is the Cheat Code?\n";
cout<<"Code:";
cin>>cheat;
if(cheat==5272){
cout<<"Welcome to DICE!\n";
cout<<"This is a Game of Chance!\n";
cout<<"You Start With 100 Creidts!\n";
cout<<"Choose a Number 1-6!\n";
cout<<"If You Guess Correctly You Gain 40 Credits!\n";
cout<<"If You Guess Incorrectly You Lose 10 Credits!\n";
cout<<"If You Achevie 1000 Credits You WIN!\n";
cout<<"The Cheat Code Activates at 200 Credits!\n";
cout<<"Please Enter Your Name!\n";
cout<<"Name:";
cin>>name;
for(int cred=100;cred<999&&cred>0;){
int creds=cred;
cout<<"\n";
srand(time(0));
int b=1+(rand()%6);
int a;
cout<<name;
cout<<" Chooses ";
cin>>a;
if(a==5272&&cred>199){
cout<<"Cheat Code Accepted!\n";
cout<<"50 Credits Added!\n";
cred=cred+50;
}
else{
if(a--==b){
cout<<"The Answer is: ";
cout<<b;
cout<<"\n";
cout<<"You Win!\n";
cred=cred+40;
}
else{
cout<<"The Correct Answer is:";
cout<<b;
cout<<"\n";
cout<<"You Lost!\n";
cout<<"Try Again!\n";
cred=cred-10;
}
}
cout<<"You Have ";
cout<<cred;
cout<<" Credits\n";
}
if(cred>299)
cout<<"The Cheat Code is 5272!\n";
if(cred>999){
cout<<"Congratulations!\n";
cout<<"You WON!\n";
cout<<"Play Again?";
cin>>z;
}
if(cred<1){
cout<<"Sorry You Ran Out of Credits!\n";
cout<<"Play Again?\n";
cin>>z;
}
}
}
if(chi!="yes"){
cout<<"Welcome to DICE!\n";
cout<<"This is a Game of Chance!\n";
cout<<"You Start With 100 Creidts!\n";
cout<<"Choose a Number 1-6!\n";
cout<<"If You Guess Correctly You Gain 40 Credits!\n";
cout<<"If You Guess Incorrectly You Lose 10 Credits!\n";
cout<<"If You Achevie 1000 Credits You WIN!\n";
cout<<"There is No Cheat Code on This Mode!\n";
cout<<"Please Enter Your Name!\n";
cout<<"Name:";
cin>>name;
for(int cred=100;cred<999&&cred>0;){
int creds=cred;
cout<<"\n";
srand(time(0));
int b=1+(rand()%6);
int a;
cout<<name;
cout<<" Chooses ";
cin>>a;
if(a--==b){
cout<<"The Answer is: ";
cout<<b;
cout<<"\n";
cout<<"You Win!\n";
cred=cred+40;
}
else{
cout<<"The Correct Answer is:";
cout<<b;
cout<<"\n";
cout<<"You Lost!\n";
cout<<"Try Again!\n";
cred=cred-10;
}
cout<<"You Have ";
cout<<cred;
cout<<" Credits\n";
}
if(cred>299){
cout<<"The Cheat Code is 5272!";
}
if(cred>999){
cout<<"Congratulations!\n";
cout<<"You WON!\n";
cout<<"Play Again?";
cin>>z;
}
if(cred<1){
cout<<"Sorry You Ran Out of Credits!\n";
cout<<"Play Again?\n";
cin>>z;
}
}
if(cheat!=5272){
cout<<"Welcome to DICE!\n";
cout<<"This is a Game of Chance!\n";
cout<<"You Start With 100 Creidts!\n";
cout<<"Choose a Number 1-6!\n";
cout<<"If You Guess Correctly You Gain 40 Credits!\n";
cout<<"If You Guess Incorrectly You Lose 10 Credits!\n";
cout<<"If You Achevie 1000 Credits You WIN!\n";
cout<<"There is No Cheat Code in This Mode!\n";
cout<<"Please Enter Your Name!\n";
cout<<"Name:";
cin>>name;
for(int cred=100;cred<999&&cred>0;){
int creds=cred;
cout<<"\n";
srand(time(0));
int b=1+(rand()%6);
int a;
cout<<name;
cout<<" Chooses ";
cin>>a;
if(a--==b){
cout<<"The Answer is: ";
cout<<b;
cout<<"\n";
cout<<"You Win!\n";
cred=cred+40;
}
else{
cout<<"The Correct Answer is:";
cout<<b;
cout<<"\n";
cout<<"You Lost!\n";
cout<<"Try Again!\n";
cred=cred-10;
}
cout<<"You Have ";
cout<<cred;
cout<<" Credits\n";
}
if(cred>299){
cout<<"The Cheat Code is 5272!\n";
}
if(cred>999){
cout<<"Congratulations!\n";
cout<<"You WON!\n";
cout<<"Play Again?";
cin>>z;
}
if(cred<1){
cout<<"Sorry You Ran Out of Credits!\n";
cout<<"Play Again?\n";
cin>>z;
}
}
}
cout<<"Good Bye!\n";
system("pause");
return 0;
}
First snippet line 32,94, second snippet line 149:
Do not call srand() within a loop or a random number function. srand() sets the RNG to a particular starting point. Calling srand() repeatedly can cause the RNG to return the same random numbers. srand() should be called ONCE at the beginning of main(). http://www.cplusplus.com/reference/cstdlib/srand/
Second snippet lines 18-28, 80-90, 135-145: You have exactly the same code in three places. You should move the repeated code to a function.
First snippet lines 7-14: Your variable names are meaningless. A well named variable should convey what it is used for.
Thanks for the code feedback but im looking for feedback of the the game. I dont have the problem described by "Do not call srand() within a loop or a random number function. srand() sets the RNG to a particular starting point. Calling srand() repeatedly can cause the RNG to return the same random numbers." It is random each time. So can you please review the result of the code instead of the code itself.
This is a programming platform though. Besides, I don't think people enjoy playing text-based games anymore.
Not to break your dreams but, game industry is pretty competitive so if you want people to play your games or be impressed by them you'll need to forget what satisfaction is for a long long time and keep learning.
I think you need to address your question by conducting a survey with a series of ratings against a set of criteria based on what targets you have in mind for the game. Let people give a rating against your targets.
Obviously it would be more appropriate that your programming was surveyed because you can improve your work. (You have decided to concentrate on the product rather than the nuts and bolts and that's OK.)
In the absence of your (short) survey questionnaire I think my feedback to you would be best described as something like your uncles, but there is no reason a text based game can't be a bit of fun or even impressive.