using System.Collections.Generic;
const int numToCreate = 3;
const string startMsg = "Guess the number please.";
const string wrongMsg = "[!]Eat-{0}, BITE-{1}, try again~";
const string rightMsg = "[✓]Bingo!";
const string digitMsg = "[!]Please input a num of three digits.";
const string closeOrNot = "[?]Open a new game?\nEnter Q to quit or any other key to continue.";
public static void Main(string[] args){
static bool Application(){
string num = CreateNums();
Console.WriteLine(startMsg);
string userInput = getUserInput();
while(CheckNum(num, userInput) == false){
userInput = getUserInput();
Console.WriteLine(rightMsg);
Console.WriteLine(closeOrNot);
string choise = Console.ReadLine();
if(choise == "Q" || choise == "q"){
Console.WriteLine("See you again~");
static string CreateNums(){
int[] numArray = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
var lNum = new List<int>(numArray);
int[] nums = new int[numToCreate];
Random rand = new Random();
for(int i=0; i<numToCreate; i++){
int index = rand.Next(startIdx, endIdx);
int num = Int32.Parse(lNum[index].ToString());
for(int i=0; i<numToCreate; i++){
int digit = Convert.ToInt32(Math.Pow(10, numToCreate-1-i));
static string getUserInput(){
string input = Console.ReadLine();
while(CheckInput(input) == false){
Console.WriteLine(digitMsg);
input = Console.ReadLine();
static bool CheckInput(string input){
static bool CheckNum(string answer, string input){
if(String.Equals(answer, input))
var answers = new List<char>();
var inputs = new List<char>();
for(int i=0; i<numToCreate; i++){
if(answer[i] == input[i])
for(int i=0; i<answers.Count; i++){
for(int j=0; j<inputs.Count; j++){
if(answers[i] == inputs[j])
Console.WriteLine(wrongMsg, eat, bite);