Example #1
0
    // Use this for initialization
    void Start()
    {
        SAB = GameObject.Find("statueArrowBottom");
        SAT = GameObject.Find("statueArrowTop");
        statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
        statueArrowTop    = (statueArrow)SAT.GetComponent("statueArrow");
        direction         = new Vector3(0, 0, 0);
        right             = new Vector3(0, 0, 270);
        left            = new Vector3(0, 0, 90);
        up              = new Vector3(0, 0, 0);
        down            = new Vector3(0, 0, 180);
        square          = new Vector2(2, 3);
        predictedSquare = new Vector2(2, 2);

        //Data collection variables
        moves = 0;
        squares_explored_list = new List <string>();
        squares_explored_list.Add("23");
        states_explored_list = new List <string>();
        states_explored_list.Add("23:25:21");
        unique_states     = 1;
        all_move          = 0;
        two_move          = 0;
        player_only_moves = 0;

        //Data collection file writing
        dataFile     = "AI_data.txt";
        outputStream = new StreamWriter(dataFile, true);
    }
	// Use this for initialization
	void Start () {
		SAB = GameObject.Find ("statueArrowBottom");
		SAT = GameObject.Find ("statueArrowTop");
		statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
		statueArrowTop = (statueArrow)SAT.GetComponent("statueArrow");
		direction = new Vector3(0,0,0);
		right = new Vector3(0,0,270);
		left = new Vector3(0,0,90);
		up = new Vector3(0,0,0);
		down = new Vector3(0,0,180);
		square = new Vector2(2,3);
		predictedSquare = new Vector2(2,2);
		
		//Data collection variables
		moves = 0;
		squares_explored_list = new List<string>();
		squares_explored_list.Add ("23");
		states_explored_list = new List<string>();
		states_explored_list.Add ("23:25:21");
		unique_states = 1;
		all_move = 0;
		two_move = 0;
		player_only_moves = 0;

		//Data collection file writing
		dataFile = "AI_data.txt";
		outputStream = new StreamWriter( dataFile, true );
		
	}
	// Use this for initialization
	void Start () {
		otherStatue = (statueArrow)OS.GetComponent("statueArrow");
		right = new Vector3(0,0,270);
		left = new Vector3(0,0,90);
		up = new Vector3(0,0,0);
		down = new Vector3(0,0,180);
		squares_explored_list = new List<string>();
		squares_explored_list.Add (coordinatesToSquare(startingSquare));
		num_traversed_squares = 1;
	}
Example #4
0
 // Use this for initialization
 void Start()
 {
     otherStatue           = (statueArrow)OS.GetComponent("statueArrow");
     right                 = new Vector3(0, 0, 270);
     left                  = new Vector3(0, 0, 90);
     up                    = new Vector3(0, 0, 0);
     down                  = new Vector3(0, 0, 180);
     squares_explored_list = new List <string>();
     squares_explored_list.Add(coordinatesToSquare(startingSquare));
     num_traversed_squares = 1;
 }
	// Use this for initialization
	void Start () {
		SAB = GameObject.Find ("statueArrowBottom");
		SAT = GameObject.Find ("statueArrowTop");
		statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
		statueArrowTop = (statueArrow)SAT.GetComponent("statueArrow");
		direction = new Vector3(0,0,0);
		right = new Vector3(0,0,270);
		left = new Vector3(0,0,90);
		up = new Vector3(0,0,0);
		down = new Vector3(0,0,180);
		square = new Vector2(2,3);
		predictedSquare = new Vector2(2,2);

		//Data collection variables
		moves = 0;
		turnCount = 0;
		avg_time_per_move = 0f;
		avg_turns_per_move = 0f;
		squares_explored_list = new List<string>();
		squares_explored_list.Add ("23");
		left_squares = 0;
		right_squares = 0;
		num_repeated_squares = 0;
		num_traversed_squares = 0;

		left_squares_list = new List<string>();
		left_squares_list.Add ("00");
		left_squares_list.Add ("10");
		left_squares_list.Add ("01");
		left_squares_list.Add ("11");
		left_squares_list.Add ("02");
		left_squares_list.Add ("12");
		left_squares_list.Add ("13");
		left_squares_list.Add ("14");

		right_squares_list = new List<string>();
		right_squares_list.Add ("30");
		right_squares_list.Add ("40");
		right_squares_list.Add ("31");
		right_squares_list.Add ("41");
		right_squares_list.Add ("32");
		right_squares_list.Add ("42");
		right_squares_list.Add ("33");
		right_squares_list.Add ("34");

		all_move = 0;
		two_move = 0;
		player_only_moves = 0;

		//Victory UI variables
		yes = GameObject.Find ("Yes").GetComponent<Button>();
		no = GameObject.Find ("No").GetComponent<Button>();
		victoryPanel = GameObject.Find ("Victory").GetComponent<Image>();
		victoryText = GameObject.Find ("Congratulations").GetComponent<Text>();

		//start file writing
		if(File.Exists(FILENAME)) {
			print ("File already exists: " + FILENAME);
		}
		sr = File.CreateText (FILENAME);
		sr.WriteLine ("NEW GAME");
		sr.WriteLine ("Gender: Female");
		sr.WriteLine ("Age: 41");

	}
Example #6
0
    // Use this for initialization
    void Start()
    {
        hintManager       = GameObject.Find("EventSystem").GetComponent <HintManager>();
        SAB               = GameObject.Find("statueArrowBottom");
        SAT               = GameObject.Find("statueArrowTop");
        statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
        statueArrowTop    = (statueArrow)SAT.GetComponent("statueArrow");
        direction         = Vector3.up;
        prevMoveDir       = direction;
        right             = new Vector3(0, 0, 270);
        left              = new Vector3(0, 0, 90);
        up              = new Vector3(0, 0, 0);
        down            = new Vector3(0, 0, 180);
        square          = new Vector2(2, 3);
        predictedSquare = new Vector2(2, 2);

        //Data collection variables
        plays                   = 1;
        victories               = 0;
        resets                  = 0;
        resultStr               = "NEW_GAME,statue,";
        moves                   = 0;
        turns                   = 0;
        pathTurns               = 0;
        longest_straight_path   = 0;
        avg_path_turns_per_move = -1f;         // actual turns in path made divided by length of path
        movementTime            = 0f;
        squares_explored_list   = new List <string>();
        squares_explored_list.Add("23");
        left_squares          = 0;
        right_squares         = 0;
        top_squares           = 0;
        bottom_squares        = 1;
        squares_explored      = 0;
        num_repeated_squares  = 0;
        num_traversed_squares = 1;
        all_move                 = 0;
        two_move                 = 0;
        player_only_moves        = 0;
        playerStatueCollide      = 0;
        playerBlockedByStatue    = 0;
        statuesBlockEachOther    = 0;
        statuesCollide           = 0;
        statueBlockedByOffscreen = 0;

        /* STATUE ARROW DATA */
        num_traversed_squares_statues = 0;         // statue Arrow will take care of this
        num_repeated_squares_statues  = 0;
        squares_explored_statues      = 2;
        left_squares_statues          = 0;
        right_squares_statues         = 0;
        bottom_squares_statues        = 1;
        top_squares_statues           = 1;

        pathTrace = coordinatesToSquare(square);         //starting square

        left_squares_list = new List <string>();
        left_squares_list.Add("00");
        left_squares_list.Add("10");
        left_squares_list.Add("01");
        left_squares_list.Add("11");
        left_squares_list.Add("02");
        left_squares_list.Add("12");
        left_squares_list.Add("13");
        left_squares_list.Add("14");

        right_squares_list = new List <string>();
        right_squares_list.Add("30");
        right_squares_list.Add("40");
        right_squares_list.Add("31");
        right_squares_list.Add("41");
        right_squares_list.Add("32");
        right_squares_list.Add("42");
        right_squares_list.Add("33");
        right_squares_list.Add("34");

        bottom_squares_list = new List <string>();
        bottom_squares_list.Add("13");
        bottom_squares_list.Add("23");
        bottom_squares_list.Add("33");
        bottom_squares_list.Add("14");
        bottom_squares_list.Add("24");
        bottom_squares_list.Add("34");
        bottom_squares_list.Add("25");

        top_squares_list = new List <string>();
        top_squares_list.Add("00");
        top_squares_list.Add("10");
        top_squares_list.Add("20");
        top_squares_list.Add("30");
        top_squares_list.Add("40");
        top_squares_list.Add("01");
        top_squares_list.Add("11");
        top_squares_list.Add("21");
        top_squares_list.Add("31");
        top_squares_list.Add("41");
        top_squares_list.Add("02");
        top_squares_list.Add("12");
        top_squares_list.Add("22");
        top_squares_list.Add("32");
        top_squares_list.Add("42");

        //Victory UI variables
        yes          = GameObject.Find("Yes").GetComponent <Button>();
        no           = GameObject.Find("No").GetComponent <Button>();
        victoryPanel = GameObject.Find("Victory").GetComponent <Image>();
        victoryText  = GameObject.Find("Congratulations").GetComponent <Text>();
    }
    // Use this for initialization
    void Start()
    {
        SAB = GameObject.Find("statueArrowBottom");
        SAT = GameObject.Find("statueArrowTop");
        statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
        statueArrowTop    = (statueArrow)SAT.GetComponent("statueArrow");
        direction         = new Vector3(0, 0, 0);
        right             = new Vector3(0, 0, 270);
        left            = new Vector3(0, 0, 90);
        up              = new Vector3(0, 0, 0);
        down            = new Vector3(0, 0, 180);
        square          = new Vector2(2, 3);
        predictedSquare = new Vector2(2, 2);

        //Data collection variables
        moves                 = 0;
        turnCount             = 0;
        avg_time_per_move     = 0f;
        avg_turns_per_move    = 0f;
        squares_explored_list = new List <string>();
        squares_explored_list.Add("23");
        left_squares          = 0;
        right_squares         = 0;
        num_repeated_squares  = 0;
        num_traversed_squares = 0;

        left_squares_list = new List <string>();
        left_squares_list.Add("00");
        left_squares_list.Add("10");
        left_squares_list.Add("01");
        left_squares_list.Add("11");
        left_squares_list.Add("02");
        left_squares_list.Add("12");
        left_squares_list.Add("13");
        left_squares_list.Add("14");

        right_squares_list = new List <string>();
        right_squares_list.Add("30");
        right_squares_list.Add("40");
        right_squares_list.Add("31");
        right_squares_list.Add("41");
        right_squares_list.Add("32");
        right_squares_list.Add("42");
        right_squares_list.Add("33");
        right_squares_list.Add("34");

        all_move          = 0;
        two_move          = 0;
        player_only_moves = 0;

        //Victory UI variables
        yes          = GameObject.Find("Yes").GetComponent <Button>();
        no           = GameObject.Find("No").GetComponent <Button>();
        victoryPanel = GameObject.Find("Victory").GetComponent <Image>();
        victoryText  = GameObject.Find("Congratulations").GetComponent <Text>();

        //start file writing
        if (File.Exists(FILENAME))
        {
            print("File already exists: " + FILENAME);
        }
        sr = File.CreateText(FILENAME);
        sr.WriteLine("NEW GAME");
        sr.WriteLine("Gender: Female");
        sr.WriteLine("Age: 41");
    }
	// Use this for initialization
	void Start () {

		SAB = GameObject.Find ("statueArrowBottom");
		SAT = GameObject.Find ("statueArrowTop");
		statueArrowBottom = (statueArrow)SAB.GetComponent("statueArrow");
		statueArrowTop = (statueArrow)SAT.GetComponent("statueArrow");
		direction = Vector3.up;
		right = new Vector3(0,0,270);
		left = new Vector3(0,0,90);
		up = new Vector3(0,0,0);
		down = new Vector3(0,0,180);
		square = new Vector2(2,3);
		predictedSquare = new Vector2(2,2);

		//Data collection variables
		plays = 1;
		victories = 0;
		resets = 0;
		resultStr = "NEW_GAME,statue,";
		moves = 0;
		turns = 0;
		movementTime = 0f;
		squares_explored_list = new List<string>();
		squares_explored_list.Add ("23");
		left_squares = 0;
		right_squares = 0;
		top_squares = 0;
		bottom_squares = 1;
		squares_explored = 0;
		num_repeated_squares = 0;
		num_traversed_squares = 1;
		all_move = 0;
		two_move = 0;
		player_only_moves = 0;
		playerStatueCollide = 0;
		playerBlockedByStatue = 0;
		statuesBlockEachOther = 0;
		statuesCollide = 0;
		statueBlockedByOffscreen = 0;

		/* STATUE ARROW DATA */
		num_traversed_squares_statues = 0; // statue Arrow will take care of this
		num_repeated_squares_statues = 0;
		squares_explored_statues = 2;
		left_squares_statues = 0;
		right_squares_statues = 0;
		bottom_squares_statues = 1;
		top_squares_statues = 1;

		left_squares_list = new List<string>();
		left_squares_list.Add ("00");
		left_squares_list.Add ("10");
		left_squares_list.Add ("01");
		left_squares_list.Add ("11");
		left_squares_list.Add ("02");
		left_squares_list.Add ("12");
		left_squares_list.Add ("13");
		left_squares_list.Add ("14");

		right_squares_list = new List<string>();
		right_squares_list.Add ("30");
		right_squares_list.Add ("40");
		right_squares_list.Add ("31");
		right_squares_list.Add ("41");
		right_squares_list.Add ("32");
		right_squares_list.Add ("42");
		right_squares_list.Add ("33");
		right_squares_list.Add ("34");

		bottom_squares_list = new List<string>();
		bottom_squares_list.Add ("13");
		bottom_squares_list.Add ("23");
		bottom_squares_list.Add ("33");
		bottom_squares_list.Add ("14");
		bottom_squares_list.Add ("24");
		bottom_squares_list.Add ("34");
		bottom_squares_list.Add ("25");

		top_squares_list = new List<string>();
		top_squares_list.Add ("00");
		top_squares_list.Add ("10");
		top_squares_list.Add ("20");
		top_squares_list.Add ("30");
		top_squares_list.Add ("40");
		top_squares_list.Add ("01");
		top_squares_list.Add ("11");
		top_squares_list.Add ("21");
		top_squares_list.Add ("31");
		top_squares_list.Add ("41");
		top_squares_list.Add ("02");
		top_squares_list.Add ("12");
		top_squares_list.Add ("22");
		top_squares_list.Add ("32");
		top_squares_list.Add ("42");

		//Victory UI variables
		yes = GameObject.Find ("Yes").GetComponent<Button>();
		no = GameObject.Find ("No").GetComponent<Button>();
		victoryPanel = GameObject.Find ("Victory").GetComponent<Image>();
		victoryText = GameObject.Find ("Congratulations").GetComponent<Text>();

	}