// // Author: Mari Kähkönen // Original base document by Timo Ehmke // Systemvariablen // =============== APPLET_WIDTH = 400 APPLET_HEIGHT = 300 WORLD_X_MAX = 16.0 WORLD_X_MIN = -16.0 WORLD_Y_MAX = +12.0 WORLD_Y_MIN = -12.0 ALIGN = LEFT // Figurenbeschreibung // =================== //pisteet e[1] = p1; point; fixed; -4.0,0.0; "hidden" e[2] = p2; point; fixed; -2.0,0.0; "hidden" e[3] = p3; point; fixed; 4.0,0.0; "hidden" e[4] = p4; point; fixed; 6.0,0.0; "hidden" e[5] = p5; point; fixed; 12.0,0.0; "hidden" e[6] = p6; point; fixed; 14.0,0.0; "hidden" e[7] = p7; point; fixed; 13.5,0.0; "hidden" e[8] = p8; point; fixed; 2.59,1.41; "hidden" e[9] = p9; point; fixed; -2.59,1.41; "hidden" e[10] = p10; point; fixed; 5.41,1.41; "hidden" e[11] = p11; point; fixed; 10.59,1.41; "hidden" e[12] = p12; point; fixed; 0.0,-6.0; "hidden" e[13] = p13; point; fixed; 8.0,-6.0; "hidden" e[14] = p14; point; fixed; 4.0,6.0; "hidden" e[15] = p15; point; fixed; -2.59,-1.41;"hidden" e[16] = p16; point; fixed; 10.59,-1.41;"hidden" e[17] = p17; point; fixed; -4.0,2.0; "hidden" e[18] = p18; point; fixed; -5.41,1.41; "hidden" e[19] = p19; point; fixed; -6.2,1.95; "hidden" e[20] = p20; point; fixed; 13.41,1.41; "hidden" e[21] = p21; point; fixed; 13.0,2.65; "hidden" e[22] = p22; point; fixed; 12.0,2.0; "hidden" e[23] = p23; point; fixed; 3.0,1.7; "hidden" e[24] = p24; point; fixed; 5.0,1.7; "hidden" e[25] = p25; point; fixed; 4.0,4.0; "hidden" e[26] = tila0; point; fixed; -5.0,0.0; "hidden" e[27] = tila1; point; fixed; 0.0,-5.0; "hidden" e[28] = tila2; point; fixed; 5.0,0.0; "hidden" e[29] = origo; point; fixed; 0.0,0.0; "hidden" e[30] = tila3; point; fixed; 0.0,5.0; "hidden" e[31] = ymp; circle; radius; origo,tila0; "hidden" e[32] = arc01; sector; sector; origo,tila0,tila1;"hidden" e[33] = arc12; sector; sector; origo,tila1,tila2;"hidden" e[34] = arc20; sector; arc; tila2,tila3,tila0;"hidden" e[35] = P1; point; dragable; -5.0,0.0,arc01; "hidden" e[36] = P2; point; dragable; 0.0,-5.0,arc12; "hidden" e[37] = P3; point; dragable; 5.0,0.0,arc20; "hidden" //tilat e[38] = snolla; circle; radius; p1,p2; 0;0;black;0 e[39] = syksi; circle; radius; p3,p4; 0;0;black;0 e[40] = skaksi; circle; radius; p5,p6; 0;0;black;0 e[41] = s3; circle; radius; p5,p7; 0;0;black;0; //siirtymät e[42] = s4; sector; arc; p8,p12,p9; 0;0;black;0; "hideLabel" e[43] = s5; sector; arc; p11,p13,p10; 0;0;black;0; "hideLabel" e[44] = s6; sector; sector; p14,p15,p16; 0;0;black;0; "hideLabel" e[45] = s7; sector; arc; p17,p19,p18; 0;0;black;0; "hideLabel" e[46] = s8; sector; sector; p21,p20,p22; 0;0;black;0; "hideLabel" e[47] = s9; sector; arc; p24,p25,p23; 0;0;black;0; "hideLabel" //animaatio pisteet e[48] = an1; point; dragable; -5.0,0.0,s4; 0;red;red;0;smallcircle e[49] = an2; point; dragable; 0.0,0.0,s5; 0;red;red;0;smallcircle e[50] = an3; point; dragable; 10.59,-1.41,s6; 0;red;red;0;smallcircle e[51] = an4; point; dragable; -5.0,0.0,s7; 0;red;red;0;smallcircle e[52] = an5; point; dragable; 12.0,2.0,s8; 0;red;red;0;smallcircle e[53] = an6; point; dragable; 0.0,0.0,s9; 0;red;red;0;smallcircle //nappulat e[54] = m2; measure; button; "a","action"; e[55] = m3; measure; button; "b","action"; e[56] = s0; point; fixed; -3.0,0.0; black;0;0;0; e[57] = s1; point; fixed; 5.0,0.0; black;0;0;0; e[58] = s2; point; fixed; 13.0,0.0; black;0;0;0; e[59] = a1; point; fixed; 1.0,3.0; 0;0;0;0; e[60] = b1; point; fixed; -4.0,4.7; 0;0;0;0; e[61] = a2; point; fixed; 5.0,4.7; 0;0;0;0; e[62] = b2; point; fixed; 9.0,3.0; 0;0;0;0; e[63] = a3; point; fixed; 0.0,-4.0; 0;0;0;0; e[64] = b3; point; fixed; 14.5,4.7; 0;0;0;0; e[65] = bbaabb; measure; JSfunction; "checkRadioButtons","bbaabb"; e[66] = aabaaab; measure; JSfunction; "checkRadioButtons","aabaaab"; e[67] = baab; measure; JSfunction; "checkRadioButtons","baab"; e[68] = m1; measure; button; "Arvioi","evaluate"; image[1] = "a10.gif", a1, -1, -1 image[2] = "a10.gif", a2, -1, -1 image[3] = "a10.gif", a3, -1, -1 image[4] = "b10.gif", b1, -1, -1 image[5] = "b10.gif", b2, -1, -1 image[6] = "b10.gif", b3, -1, -1 //animaatiot //ensimmäistä kertaa tilassa snolla painetaan a:ta anim[1] = "if ((calculate(m2))&(isIncident(P1,tila0))&(isIncident(P2,tila1))) animate (an1,10,1,100,1)" anim[2] = "if (isIncident(an1,syksi)) animate (P1,10,0,100,1)" //tilassa snolla painetaan b:tä anim[3] = "if ((calculate(m3))&(isIncident(P1,tila0))&(isIncident(P2,tila1))) animate (an4,10,1,100,1)" //tilassa syksi painetaan a:ta anim[4] = "if ((calculate(m2))&(isIncident(P1,tila1))) animate (an6,10,1,100,1)" //tilassa syksi painetaan b:tä anim[5] = "if ((calculate(m3))&(isIncident(P1,tila1))) animate (an2,10,1,100,1)" anim[6] = "if (isIncident(an2,skaksi)) animate (P2,10,0,100,1)" anim[7] = "if (isIncident(an2,skaksi)) animate (P1,10,1,100,1)" //tilassa skaksi painetaan a:ta anim[8] = "if ((calculate(m2))&(isIncident(P2,tila2))) animate (an3,10,1,100,1)" anim[9]= "if (isIncident(an3,snolla)) animate (P2,10,1,100,1)" //tilassa skaksi painetaan b:tä anim[10]= "if ((calculate(m3))&(isIncident(P2,tila2))) animate (an5,10,1,100,1)" MAX_ANSWER = 0 //JS:stä saadaan arvo 0 jos valittu on, 1 jos valittu ei ole condition[1] = "(calculate(bbaabb))" condition[2] = "(calculate(aabaaab))" condition[3] = "(calculate(baab))" //relaatio on antisymmetrinen ja transitiivinen key = "condition[1] AND condition[2] AND condition[3]" comment[1] = " OIKEIN!" key = "1" comment[1] = " Tämä vastaus ei ole oikein. /n Muistathan, että vain s2 on hyväksyvä tila! /n Yritä uudelleen."