// // Autor: Timo Ehmke (ehmke@uni-flensburg.de) // // Systemvariablen // =============== gridSize = 20 snapToGrid = true showGrid = false WORLD_X_MAX = +16.0 WORLD_X_MIN = -16.0 WORLD_Y_MAX = +12.0 WORLD_Y_MIN = -12.0 APPLET_WIDTH = 640 APPLET_HEIGHT = 480 // Figurenbeschreibung // =================== e[1] = O; point; fixed; 0.0,0.0; "hidden" e[2] = Qu1; point; free; -13.0,7.0; "hidden" e[3] = Qu2; point; free; -13.0,5.0; "hidden" e[4] = Qu3; point; free; -13.0,3.0; "hidden" e[5] = Qu4; point; free; -13.0,1.0; "hidden" e[6] = Qu5; point; free; -13.0,-1.0; "hidden" e[7] = Qu6; point; free; -13.0,-3.0; "hidden" e[8] = Qu7; point; free; -13.0,-5.0; "hidden" e[9] = Qu8; point; free; -13.0,-7.0; "hidden" e[10] = f1; measure; function; "Functional_EightQueens","Qu1","Qu2","Qu3","Qu4","Qu5","Qu6","Qu7","Qu8","analyse",13.0,10.0,"f = ",""; "hidden" e[11] = f2; measure; function; "Functional_EightQueens","Qu1","Qu2","Qu3","Qu4","Qu5","Qu6","Qu7","Qu8","hint_x",13.0,9.0,"x = ",""; "hidden" e[12]= f3; measure; function; "Functional_EightQueens","Qu1","Qu2","Qu3","Qu4","Qu5","Qu6","Qu7","Qu8","hint_y",13.7,4.8,"",""; e[13] = Vorschlag:; point; free; 9.0,5.0; black;background;background;0 e[14] = A; point; free; 13.0,5.0; black;background;background;0 e[15] = B; point; free; 13.0,5.0; black;background;background;0 e[16] = C; point; free; 13.0,5.0; black;background;background;0 e[17] = D; point; free; 13.0,5.0; black;background;background;0 e[18] = E; point; free; 13.0,5.0; black;background;background;0 e[19] = F; point; free; 13.0,5.0; black;background;background;0 e[20] = G; point; free; 13.0,5.0; black;background;background;0 e[21] = H; point; free; 13.0,5.0; black;background;background;0 e[22] = ---; point; free; 13.0,5.0; black;background;background;0 e[23] = e[24] = sw2; measure; checkbox; "Show hint",0; e[25] = cond1; measure; calculate; "if (calculate(f1) != 0.0) then (1.0) else (0.0)"; e[26] = cond2; measure; calculate; "if (calculate(f1) != 1.0) then (1.0) else (0.0)"; e[27] = cond3; measure; calculate; "if (calculate(f1) != 2.0) then (1.0) else (0.0)"; e[28] = cond4; measure; calculate; "if (calculate(f1) != 3.0) then (1.0) else (0.0)"; e[29] = cond5; measure; calculate; "if (calculate(f1) != 4.0) then (1.0) else (0.0)"; e[30] = cond6; measure; calculate; "if (calculate(f1) != 5.0) then (1.0) else (0.0)"; e[31] = cond7; measure; calculate; "if (calculate(f1) != 6.0) then (1.0) else (0.0)"; e[32] = cond8; measure; calculate; "if (calculate(f2) != 1.0) then (1.0) else (0.0)"; e[33] = cond9; measure; calculate; "if (calculate(f2) != 2.0) then (1.0) else (0.0)"; e[34] = cond10; measure; calculate; "if (calculate(f2) != 3.0) then (1.0) else (0.0)"; e[35] = cond11; measure; calculate; "if (calculate(f2) != 4.0) then (1.0) else (0.0)"; e[36] = cond12; measure; calculate; "if (calculate(f2) != 5.0) then (1.0) else (0.0)"; e[37] = cond13; measure; calculate; "if (calculate(f2) != 6.0) then (1.0) else (0.0)"; e[38] = cond14; measure; calculate; "if (calculate(f2) != 7.0) then (1.0) else (0.0)"; e[39] = cond15; measure; calculate; "if (calculate(f2) != 8.0) then (1.0) else (0.0)"; e[40] = cond16; measure; calculate; "if (calculate(f2) = -1.0) then (1.0) else (0.0)"; e[41] = b1; measure; button; "Evaluation","evaluate"; // Ein- und Ausblenden von Objekten // ================================ hidden[1] = "if (not(calculate(sw2))) hide (Vorschlag:)" hidden[2] = "if (not(calculate(sw2))|calculate(cond8)) hide (A)" hidden[3] = "if (not(calculate(sw2))|calculate(cond9)) hide (B)" hidden[4] = "if (not(calculate(sw2))|calculate(cond10)) hide (C)" hidden[5] = "if (not(calculate(sw2))|calculate(cond11)) hide (D)" hidden[6] = "if (not(calculate(sw2))|calculate(cond12)) hide (E)" hidden[7] = "if (not(calculate(sw2))|calculate(cond13)) hide (F)" hidden[8] = "if (not(calculate(sw2))|calculate(cond14)) hide (G)" hidden[9] = "if (not(calculate(sw2))|calculate(cond15)) hide (H)" hidden[10] = "if (not(calculate(sw2))|calculate(cond16)) hide (f3)" hidden[11] = "if (not(calculate(sw2))|not(calculate(cond16))) hide (---)" // Bild-Dateien einbinden // ====================== image[1] = "problem_of_the_eight_queens_image01.gif", O, -1, -1 image[2] = "problem_of_the_eight_queens_image02.gif", Qu1, -1, -1 image[3] = "problem_of_the_eight_queens_image02.gif", Qu2, -1, -1 image[4] = "problem_of_the_eight_queens_image02.gif", Qu3, -1, -1 image[5] = "problem_of_the_eight_queens_image02.gif", Qu4, -1, -1 image[6] = "problem_of_the_eight_queens_image02.gif", Qu5, -1, -1 image[7] = "problem_of_the_eight_queens_image02.gif", Qu6, -1, -1 image[8] = "problem_of_the_eight_queens_image02.gif", Qu7, -1, -1 image[9] = "problem_of_the_eight_queens_image02.gif", Qu8, -1, -1 // Antwortanalyse // ============== MAX_ANSWER = 0 condition[1] = "calculate(f1) = 0" condition[2] = "calculate(f1) = 1" condition[3] = "calculate(f1) = 2" condition[4] = "calculate(f1) = 3" condition[5] = "calculate(f1) = 4" condition[6] = "calculate(f1) = 5" condition[7] = "calculate(f1) = 6" key = "condition[1]" comment[1] = " Your answer could not be checked. /n There is no queen on the board. /n Please place a queen." key = "condition[2]" comment[1] = " Your answer could not be checked. /n Perhaps one queen is not placed correctly on the board. /n Please try again." key = "condition[3]" comment[1] = " Your answer is not right. /n In this constellation at least two queens threaten each other. /n Please try again." key = "condition[4] OR condition[6] " comment[1] = " Until now, your answer is right. /n Please place the next queen." key = "condition[5]" comment[1] = " Your answer is not right. /n In this constellation there is no more solution available. /n Please change the constellation on the board." key = "condition[6]" comment[1] = " Right. /n In this constellation the eight queens don't threaten each other. " key = "condition[7]" comment[1] = " Right. /n In this constellation the eight queens don't threaten each other. "