public void CheckResults()
    {
        lightsFirstLine.GetComponent <LightsController>().InitLightsWithMistakes(firstNumber);
        lightsSecondLine.GetComponent <LightsController>().InitLightsWithMistakes(secondNumber);
        lightsResult.GetComponent <LightsController>().InitLightsWithMistakes(linesSum);
        this.SetSFFlags();


        if (!userInformationLightController.timeIsOver())
        {
            userInformationLightController.addTaskDone();

            if (!this.AnswerHasMistakes())
            {
                userInformationLightController.addTaskDoneRight();
            }
        }
    }
示例#2
0
    public void InitTaskValues()
    {
        lightsFirstLine.GetComponent <LightsController>().ResetLights();
        lightsSecondLine.GetComponent <LightsController>().ResetLights();
        lightsResult.GetComponent <LightsController>().ResetLights();
        lightsUserInput.GetComponent <LightsController>().ResetLights();

        firstNumber  = Random.Range(1, (int)Mathf.Pow(2, numberInPower));
        secondNumber = Random.Range(1, (int)Mathf.Pow(2, numberInPower));
        linesSum     = firstNumber + secondNumber;

        taskText.text = firstNumber + " + " + secondNumber;

        userInformationLightController.addTaskDone();

        // lightsUserInput.GetComponent<LightsController>().InitLights();
    }
示例#3
0
    public void ResetLightsAddition()
    {
        int sum = lightsFirstLine.GetComponent <LightsController>().LightsValue + lightsSecondLine.GetComponent <LightsController>().LightsValue;

        lightsResult.GetComponent <LightsController>().StopCoroutineResult(sum, lightsResultIndicator, lightsFirstLine, lightsSecondLine, lightsUserInput);

        if (lightsResult.GetComponent <LightsController>().isAnswerCorrect)
        {
            userInformationLightController.addTaskDoneRight();
        }

        StopAllCoroutines();
        userInformationLightController.addTaskDone();

        lightsFirstLine.GetComponent <LightsController>().InitLights();
        lightsSecondLine.GetComponent <LightsController>().InitLights();
        lightsResult.GetComponent <LightsController>().ResetLights();
        lightsUserInput.GetComponent <LightsController>().ResetLights();
    }
    public void CheckResults()
    {
        int sum = lightsFirstLine.GetComponent <LightsController>().LightsValue + lightsSecondLine.GetComponent <LightsController>().LightsValue;

        lightsResult.GetComponent <LightsController>().ShowLightsResult(sum, lightsResultIndicator, lightsFirstLine, lightsSecondLine, lightsUserInput);

        if (!userInformationLightController.timeIsOver())
        {
            userInformationLightController.addTaskDone();

            Debug.Log(lightsResult.GetComponent <LightsController>().CalculateLightsValue());
            Debug.Log(lightsUserInput.GetComponent <LightsController>().CalculateLightsValue());
            Debug.Log(lightsFirstLine.GetComponent <LightsController>().CalculateLightsValue());
            Debug.Log(lightsSecondLine.GetComponent <LightsController>().CalculateLightsValue());

            if (lightsResult.GetComponent <LightsController>().CalculateLightsValue() == lightsUserInput.GetComponent <LightsController>().CalculateLightsValue())
            {
                userInformationLightController.addTaskDoneRight();
            }
        }
    }
示例#5
0
    /*Valdymo perdavimas [4]Besąlyginis valdymo perdavimas [3]UŽDAVINYS NR.1
     * Uždavinio sąlyga:Registras SS=ABCD, registras SP=0002,
     * registras BP=AF00, registras CX=0010.
     * Kokia bus stekosegmento baito su adresu FFFE reikšmė šešioliktainėje sistemoje,
     * įvykdžius komandą:1234 9A EBFE6789call text (1234 yra poslinkis kodo segmente)*/
    public void InitTask()
    {
        ipDecValue    = Random.Range(4096, (int)(Mathf.Pow(2, 16)));
        ipNewDecValue = ipDecValue + 5;

        spDecValue = Random.Range(4096, (int)(Mathf.Pow(2, 16)));


        axValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        bxValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        cxValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        dxValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        csValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        ssValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        spValue.text = spDecValue.ToString("X");
        bpValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        siValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        diValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        dsValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");
        esValue.text = Random.Range(4096, (int)(Mathf.Pow(2, 16))).ToString("X");

        ipValue.text = ipDecValue.ToString("X");


        codeSegmentMainLine.text = ipDecValue.ToString("X") + ": 9A " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X")
                                   + " " + Random.Range(16, (int)(Mathf.Pow(2, 8))).ToString("X");

        codeSegmentUpLine.text   = (ipDecValue - 8).ToString("X") + ": ?? ?? ?? ?? ?? ?? ?? ??";
        codeSegmentDownLine.text = (ipDecValue + 8).ToString("X") + ": ?? ?? ?? ?? ?? ?? ?? ??";

        memoryScrollViewController.initTask(spDecValue);

        userInformationLightController.addTaskDone();
    }