DOS c++ apps and compatibility with other computers

  • (2 Pages)
  • +
  • 1
  • 2

28 Replies - 1358 Views - Last Post: 04 September 2011 - 12:06 PM Rate Topic: -----

#1 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

DOS c++ apps and compatibility with other computers

Posted 30 August 2011 - 06:24 PM

Hello dream in code community! I have recently developed some c++ DOS apps (mainly games, the're easy to write), now I have a problem when loading them on other computers with windows. The computer loads the error include or needs msd2000 I believe this stands for Microsoft DOS 2000 but i do not know what to do, like include a library or download something to the computer. I am using microsoft c++ express 2010 edition. Here is one of my codes to a text based game I made (it would also be nice if you guys could link some tutorials such as including random number generators and saving user progress)

// adventure.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
const int Colours = system("color 41");

int _tmain(int argc, _TCHAR* argv[])
{
	string attChoice, attChoice2;

	int areaChoice1, direction;
int money = -400, fur = 0, strength = 10, cotton = 0; 
cout <<"\t Adventure version 1.3 by ncl\n"
	   "You walk into Havana in dept.\n"
	   "You owe quite a bit of money, and have nothing\n"
	   "but the clothes on your back. hopefully in 40 days\n"
	   "You will be rich, but for now you'll have to make your way in the new world\n"
	   "1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 11)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you try to give him a overdose of pain\n"
				   " Instead he punches you and you fall to the gaound in pain";
			strength -= 1;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 11)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 11)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " You go to punch but instead he mugs you\n";
			money -= 25;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 25 money\n";
			money -= 25;
			break;}
cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You gain 50 money\n";
			money == 50;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 100 money\n";
			money -= 100;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You gain 200 money\n";
			money += 200;
			break;}
			cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
		cout  <<" A guy acuses you of cheating,\n"
			" You try and fight him\n";
		
		if (strength < 13)
		{cout <<"You lost the fight";
		money -= 50;}
		if ( strength > 13 )
		{cout <<"You win the fight";
		money += 50;}      }
	system ("PAUSE");
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 10 money\n";
			money -= 10;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 40 money\n";
			money += 40;
			break;}

		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 13)
			{
				cout <<"You killed some boars and found hidden treasure\n";
				 fur += 5;
				 money +=200;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 300 money\n";
			money -= 300;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 10 money\n";
			money -= 10;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 50 money\n";
			money -= 50;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 40 money\n";
			money -= 40;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 500 money\n";
			money -= 500;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 400 money\n";
			money += 400;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 14)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 14)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 20 money\n";
			money -= 20;
			break;}
    	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 600 money\n";
			money -= 600;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 16)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 40 money\n";
			money -= 40;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 16)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 100 money\n";
			money += 100;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 11)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 12)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 100 money\n";
			money -= 100;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 200 money\n";
			money -= 200;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 20 money\n";
			money -= 20;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 900 money\n";
			money += 900;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 10 money\n";
			money -= 10;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 50 money\n";
			money -= 50;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 200 money\n";
			money -= 200;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>Punch a guy who insulted you\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << " cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 17)
			{   cout <<"You barely escape a violent boar with your life\n"
				"You should fight more often\n";
			}
			if (strength > 17)
			{
				cout <<"You killed some boars\n";
				 fur += 5;
			}
			break;}
      switch (areaChoice1){
		case 5:
			cout <<" A man says 'n00bs like you don't belong in video games'\n"
				   " In response you give him a overdose of pain\n";
			strength += 1;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 500 money\n";
			money -= 500;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But You find some cotton\n";
			cotton += 10;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 1 money\n";
			money += 1;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 100 money\n";
			money -= 100;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 50 money\n";
			money -= 50;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 10 money\n";
			money += 10;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 50 money\n";
			money -= 50;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 100 money\n";
			money += 100;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 5 money\n";
			money -= 5;
			break;}
		cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 20)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 20)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 100 money\n";
			money -= 100;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 60)
			{   cout <<"You barely escape a violent Bill Gates with your life\n"
				"He did sack you though\n";
			money -= 100;
			cotton -= 100;
			fur -= 100;
			}
			if (strength > 60)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 10 money\n";
			money -= 10;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 25)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 25)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 1 money\n";
			money -= 1;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 25)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 25)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You lose 25 money\n";
			money -= 25;
			break;}
	cout <<"1>Display inventory\n"
	   "2>Sell 10 fur\n"
	   "3>Buy 10 fur\n"
	   "4>Search islands for treasure\n"
	   "5>sell 10 cotton\n"
	   "6>Gamble\n";
 cin >>areaChoice1;
        cout << "\n";
    switch (areaChoice1){
        case 1:
	cout <<"You have" << money << " money\n"
		"You have" << fur << " fur\n"
		"You have" << cotton <<" cotton\n";
	break;}
	
	switch (areaChoice1){
        case 2: fur -= 10;
			    money += 20;
				break;}
		switch (areaChoice1){
        case 3: 
             fur += 10;
			  money -= 20;
			  break;}
		switch (areaChoice1){
		case 4:
			if (strength < 25)
			{   cout <<"You barely escape a violent boar with your life\n"
				"But you got some experiance in fighting boars\n";
			strength += 1;
			}
			if (strength > 25)
			{
				cout <<"You killed some boars and found some cotton\n";
				 cotton += 10;
				fur += 5;
			}
			break;}
  
    switch (areaChoice1){
		case 5:
			cotton -= 10;
			money += 40;
			break;}
	switch (areaChoice1){
		case 6:
			" You win 10,000 money\n";
			money += 10000;
			break;}

cout <<"You ended the game with" << money << " money\n"
		 "You ended the game with" << fur << " fur\n"
		 "You ended the game with" << cotton <<" cotton\n";
	system("pause>nul") ;
	return 0;
}


This post has been edited by no2pencil: 30 August 2011 - 06:31 PM
Reason for edit:: Added code tags


Is This A Good Question/Topic? 0
  • +

Replies To: DOS c++ apps and compatibility with other computers

#2 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 30 August 2011 - 11:56 PM

The 2000 refers not to DOS, but to the Windows 2000 kernel, which would readily run your console game, I believe (not positive). Windows XP has a virtual environment for running console (16 bit) programs, as well. In these console environments, memory can be in short supply, frequently to about 600KB, (640KB max), and your program is perhaps too big.

What compiler did you use to create this program? What OS are you trying to run it on? Details are needed here. ;)

The game shows a lot of energy and creative thinking, but your program design needs to be modular (use functions), REALLY badly. All those repeating lines of code (most of them at least), should go into ONE function, and be called numerous times - NOT repeated numerous times in your code. That alone, will considerably shorten your game, and make it much easier to work on in the future, when you want to change something, extend it, or whatever.

What I'd suggest is modularize it, and make it short and efficient with memory. Then try it on a Windows XP or Windows 2000 PC. (I have a Windows 2000 PC I can try it on, but I can't compile it. Make a compiled version, and I'll give it a shot).
Was This Post Helpful? 0
  • +
  • -

#3 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

Re: DOS c++ apps and compatibility with other computers

Posted 31 August 2011 - 06:04 PM

Thank you for responding so quickly, and the repeated lines of code are because I don't know how to make "loops" because I don't have programming books and this site is the only thing I am getting to learn c++ but I made another game that was pretty similar in design to this but it didn't work on other computers with win xp or vista.
I am using microsoft visual 2010 express c++ as a compiler and running windows 7 as an OS
sadly this site will not allow me to attach the game
Was This Post Helpful? 0
  • +
  • -

#4 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 31 August 2011 - 10:19 PM

Fortunately for you, there is a lot of C++ tutorial info, for free, around the net. Including YouTube (a bunch of vid's), which has actual college beginning programming tutorials (general), and some C++ stuff as well.

So seek and ye shall find. ;)

For your game, I don't mean just loops, I mean use functions. Consider the small example here, (this is C, I don't program in C++, anymore.):

#include <stdio.h>

void messages(char *[], int);

int main(void) {
   int i;
   char *msg[]= {
   {"As you walk to the door to leave, "},
   {"nobody seems to care"},
   {"several pairs of glaring eyes follow you, but nobody moves"},
   {"one man reaches for his Bowie knife.\nYou reach for your Colt"},
   {"the pretty singer begins another song"},
   {"a drunken brawl breaks out over in the corner"},
   {"the bartender thanks you for the tip you left him"}
   };
   for(i=1;i<7;i++) {
      messages(msg, i);
      printf(".\n\n Please Press Enter, %d more times\n\n", 7-i);
      getchar();
   }

   return 0;
}
void messages(char *msg[], int num) {
  printf("%s%s", msg[0],msg[num]);

}


I can pass the msg array around to any function I like, and have any message in there, printed up as many times as I want, and never repeat the message text.


You can upload your game here, and I'll get it. Post the url Swoopshare gives you, so I can d/l it.
http://en.swoopshare.com/

This post has been edited by Adak: 01 September 2011 - 04:41 AM

Was This Post Helpful? 0
  • +
  • -

#5 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

Re: DOS c++ apps and compatibility with other computers

Posted 01 September 2011 - 03:53 AM

Thanks for the site, that made things easier I know %d declares the users response to something but I don't know how to use it. Here is the url for my program
http://en.swoopshare...venture&lang=en
Was This Post Helpful? 0
  • +
  • -

#6 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

Re: DOS c++ apps and compatibility with other computers

Posted 01 September 2011 - 04:09 AM

But I realy want to make my programs work on other windows 7 computers, is that possible with a CLR console application?
Was This Post Helpful? 0
  • +
  • -

#7 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 01 September 2011 - 05:03 AM

Sure you can, but you threw me off. You aren't making a DOS application, you're making a *console* application. Wipe the word DOS right out of your mind, OK? It's gone - Poof!

If you can't get your console application to work, you need to find out what that error means, and nobody knows better what that is that good old Google search. I haven't used that compiler. Just for fun though, is your project type for this program, a simple console application? (click project tab and options, to see what type it is).

For random numbers, the general for is:

1) include the stdio library header. For C, it's stdio.h

2) use srand(unsigned int seed). To "seed" the random number function. The way rand() works is, without this, it will repeat the very same random numbers, one right after the other. This is a great help for testing, but surely not what you want. You use srand() just *ONCE*, and always before you use rand() for the first time. Again - use it just once, and early.

3) int rnumber = rand() % 10; Gives a random number between 0 and 9.
int rnumber2 = rand() % 10 + 1; returns a random number between 1 and 10

VERY important to note that when you put all the possible random numbers, into just a very few numbers like this, (0-9) or (1-10), etc., the randomness of the numbers, is really not kept. If you want REAL random numbers (OK, all these *random* numbers are really pseudo random numbers), but if you want them to be pretty good, you need to enlarge the possible outcome and for really good randomness, use a library for it, like the "Mersenne Twister".

http://www.math.sci....ANG/c-lang.html
http://en.wikipedia....ersenne_twister

I'm going to take a look at your program, and alter the program I posted above, to use random messages. Back later on.

OK, I see what happened. You compiled a program that is not a free standing exe program. It needs the dot dll file so it can run.

Change your project options. You want to make the project a free standing console application that does NOT require any dot dll run-time, support.

This is probably a better example of using srand().
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(void)
{
  int x ;
  srand((unsigned)time(NULL));

  for(x=0;x<=20;x++)
    printf("%i\t",rand());

  return 0;
}



Here, it uses the time of day, as an unsigned int, to seed srand(). This works out very well, as long as your program doesn't re-start, in less than a second.

This post has been edited by Adak: 01 September 2011 - 05:30 AM

Was This Post Helpful? 0
  • +
  • -

#8 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

Re: DOS c++ apps and compatibility with other computers

Posted 01 September 2011 - 05:27 PM

:oops: It was already w win32 console app but I still don't get what I need to do to make this work for computers, and for the DOS app well it looked in like it was in DOS format and I know those apps work on windows. And not to be rude but I also would like to know how to make apps save and open user progress, I WAS working on a word processor called typos but I never found out how to save the user's text.
Is there a c++ for dummies book?

Sorry for all those questions at once, I just have this habit to say what I'm thinking (and that gets my teachers really angry at me)
Was This Post Helpful? 0
  • +
  • -

#9 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 01 September 2011 - 08:20 PM

I run win32 console apps, all the time, so something is amiss. A free standing app doesn't need a dll to run. Maybe a setting is wrong, or maybe one of the files in your install has some bit rot. At this point, it's not a C issue, it's a compiler issue. I'd go to the MS compiler support website, and seek help there.

You can save information in a file, or in memory. The first is relatively permanent, the latter definitely is temporary. You have to use one or the other, since that is the only places that a PC has to save anything.

I don't know what you mean by "open user progress". If you want to save incrementally, then you want to open the file in append mode, or write the data into memory, at the end of the previous data, to keep it in order. (If that's what you want to do, I'm not sure.)
Was This Post Helpful? 0
  • +
  • -

#10 spiceweasel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 30-August 11

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 03:26 AM

I knew their was some sort of catch with a free compiler made by microsoft, now I know what it is <_< I feel ripped off. Any new compiler suggestions?

But I got these files to other computers by attaching them to a email and logging on that email and downloading the file, maybe that's whats wrong, maybe it will only work on windows 7. Anyway thanks for the help
Was This Post Helpful? 0
  • +
  • -

#11 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 03:46 AM

I believe not. You simply have the wrong settings for the program. You're the only person I've heard of with this complaint, and that's the most popular C++ compiler on the planet.

Google the problem, and I believe you'll find your answer - it may be in your own help file. Have you read it through?

The PC I tried to run the program on, has Windows 7 32 & 64 bit OS.

I use the Pelles C (no C++ though) compiler, so that is probably no help to you.
Was This Post Helpful? 0
  • +
  • -

#12 Karel-Lodewijk  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 449
  • View blog
  • Posts: 849
  • Joined: 17-March 11

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 05:16 AM

Well, I don't really see you using many dos specific things. I commented out //#include "stdafx.h", and fixed the 4 or so lines the compiler complained about. It compiled fine after that. I used gcc 4.5.2 on ubuntu, but gcc tends to be the most picky, so any compiler would probably work.

Spoiler


If you never get it to work on windows 7, know that it has runs on linux :).

Now I seem to have raked up some depth, and I haven't got anything to sell, I probably should do something about that :).

This post has been edited by Karel-Lodewijk: 02 September 2011 - 05:18 AM

Was This Post Helpful? 0
  • +
  • -

#13 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 05:26 AM

I know next to nothing about header files in C++, but I do recall hearing something about headers with a dot h file extension, were deprecated now, and shouldn't be used any more.

Don't know if that's true or not, though.
Was This Post Helpful? 0
  • +
  • -

#14 jimblumberg  Icon User is offline

  • member icon


Reputation: 3993
  • View blog
  • Posts: 12,323
  • Joined: 25-December 09

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 05:58 AM

Can you post the complete error message exactly as it appears? You may need to either statically link the Microsoft standard libraries or distribute the .dll with your program. See this link: Determining Which DLLs to Redistribute, and also Run-time Libraries

Jim
Was This Post Helpful? 0
  • +
  • -

#15 Karel-Lodewijk  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 449
  • View blog
  • Posts: 849
  • Joined: 17-March 11

Re: DOS c++ apps and compatibility with other computers

Posted 02 September 2011 - 06:19 AM

Ok, so the game is basically the same thing copied 40 times. You certainly seem committed to this, but it would be wise to pick up a bit more programming skill. I'll get you on your way. The first sane thing would be to put the choices for the initial location inside a loop. like this.

Spoiler


You might have noticed I fixed some bugs along the way.

Now, you might want the game to change, go to new locations, do new things, you want to be able to move back and forth between locations. So we are going to put this into a function called startTown. But we want the inventory and other player stats to be shared by all location, so we do two things, we make a structure player and group this data, then we give this player to the function so it can refer to it.

Spoiler


Now we want a new location, we just add another function, that takes a player and call that one when the player goes to that new location. I've demonstrated this, by adding a mountain range to the east.

Spoiler


For the experts: On any recent compiler this won't keep increasing the call stack infinitively because it is subject to tail recursion optimization.

This should get you started to continue your game a little bit cleaner and a little bit more efficiently.

This post has been edited by Karel-Lodewijk: 02 September 2011 - 06:21 AM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2