main.cpp

来自「an artifical intelligence program」· C++ 代码 · 共 86 行

CPP
86
字号
/* AI challenge - Guess The Object
   DO NOT MODIFY ANY PART OF THIS FILE 

   Copyright 2004
   Daniel Vukadinovic, alphabox.co.sr */

#include <iostream.h>
#include "robot.cpp"

//USER INPUTS
int inputThree1;
int inputThree2;
int inputThree3;
int inputFour1;
int inputFour2;
int inputFour3;
int inputFour4;

//THREE SQUARES OBJECT
void ThreeSquaresObject()
{
	cout << endl;
	cout << "Three Squares Object" << endl;
	cout << "Input first number: ";
	cin >> inputThree1;
	cout << "Input second number: ";
	cin >> inputThree2;
	cout << "Input third number: ";
	cin >> inputThree3;

	GuessTheObjectThree();
}

//FOUR SQUARES OBJECT
void FourSquaresObject()
{
	cout << endl;
	cout << "Four Squares Object" << endl;
	cout << "Input first number: ";
	cin >> inputFour1;
	cout << "Input second number: ";
	cin >> inputFour2;
	cout << "Input third number: ";
	cin >> inputFour3;
	cout << "Input fourth number: ";
	cin >> inputFour4;

	GuessTheObjectFour();
}

//PROGRAM START
int main()
{
	int choice;

	//DISPLAYS NUMBER NET
	cout << endl;
	cout << "      Guess The Object" << endl;
	cout << endl;
	cout << " |  1|  2|  3|  4|  5|  6|" << endl;
	cout << " |  7|  8|  9| 10| 11| 12|" << endl;
	cout << " | 13| 14| 15| 16| 17| 18|" << endl;
	cout << " | 19| 20| 21| 22| 23| 24|" << endl;
	cout << " | 25| 26| 27| 28| 29| 30|" << endl;
	cout << " | 31| 32| 33| 34| 35|  6|" << endl;
	cout << endl;
	cout << endl;

	//WHAT KIND OF OBJECT
	cout << "Three squares object [1]" << endl;
	cout << "Four squares object  [2]" << endl;
	cout << "Your choice: ";
	cin >> choice;

	if (choice == 1)
	{
		ThreeSquaresObject();
	}
	else
		if (choice == 2)
		{
			FourSquaresObject();
		}

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?