Browse code

FTC added

Lorenz Glaser authored onWed/Sep/2020 18:0:nd
Showing43 changed files
1 1
new file mode 100644
2 2
Binary files /dev/null and b/FTC/02 - Let Her Go.mp3 differ
3 3
new file mode 100755
4 4
Binary files /dev/null and b/FTC/backup/backup_01-28-2020_14-19-03-57.zip differ
5 5
new file mode 100755
6 6
Binary files /dev/null and b/FTC/backup/backup_02-04-2020_20-33-52-29.zip differ
7 7
new file mode 100755
8 8
Binary files /dev/null and b/FTC/gfx_old/blau.png differ
9 9
new file mode 100755
10 10
Binary files /dev/null and b/FTC/gfx_old/blau_pressed.png differ
11 11
new file mode 100755
12 12
Binary files /dev/null and b/FTC/gfx_old/braun.png differ
13 13
new file mode 100755
14 14
Binary files /dev/null and b/FTC/gfx_old/braun_pressed.png differ
15 15
new file mode 100755
16 16
Binary files /dev/null and b/FTC/gfx_old/check_pressed.png differ
17 17
new file mode 100755
18 18
Binary files /dev/null and b/FTC/gfx_old/check_unpressed.png differ
19 19
new file mode 100755
20 20
Binary files /dev/null and b/FTC/gfx_old/gelb.png differ
21 21
new file mode 100755
22 22
Binary files /dev/null and b/FTC/gfx_old/gelb_pressed.png differ
23 23
new file mode 100755
24 24
Binary files /dev/null and b/FTC/gfx_old/gruen.png differ
25 25
new file mode 100755
26 26
Binary files /dev/null and b/FTC/gfx_old/gruen_pressed.png differ
27 27
new file mode 100755
28 28
Binary files /dev/null and b/FTC/gfx_old/info_pressed.png differ
29 29
new file mode 100755
30 30
Binary files /dev/null and b/FTC/gfx_old/info_unpressed.png differ
31 31
new file mode 100755
32 32
Binary files /dev/null and b/FTC/gfx_old/leichtgrau.png differ
33 33
new file mode 100755
34 34
Binary files /dev/null and b/FTC/gfx_old/leichtgrau_pressed.png differ
35 35
new file mode 100755
36 36
Binary files /dev/null and b/FTC/gfx_old/lila.png differ
37 37
new file mode 100755
38 38
Binary files /dev/null and b/FTC/gfx_old/lila_pressed.png differ
39 39
new file mode 100755
40 40
Binary files /dev/null and b/FTC/gfx_old/refresh_pressed.png differ
41 41
new file mode 100755
42 42
Binary files /dev/null and b/FTC/gfx_old/refresh_unpressed.png differ
43 43
new file mode 100755
44 44
Binary files /dev/null and b/FTC/gfx_old/rot.png differ
45 45
new file mode 100755
46 46
Binary files /dev/null and b/FTC/gfx_old/rot_pressed.png differ
47 47
new file mode 100755
48 48
Binary files /dev/null and b/FTC/gfx_old/schwarz.png differ
49 49
new file mode 100755
50 50
Binary files /dev/null and b/FTC/gfx_old/schwarz_pressed.png differ
51 51
new file mode 100755
52 52
Binary files /dev/null and b/FTC/gfxblau.png differ
53 53
new file mode 100755
54 54
Binary files /dev/null and b/FTC/gfxbraun.png differ
55 55
new file mode 100755
56 56
Binary files /dev/null and b/FTC/gfxgelb.png differ
57 57
new file mode 100755
58 58
Binary files /dev/null and b/FTC/gfxgruen.png differ
59 59
new file mode 100755
60 60
Binary files /dev/null and b/FTC/gfxlila.png differ
61 61
new file mode 100755
62 62
Binary files /dev/null and b/FTC/gfxrot.png differ
63 63
new file mode 100755
... ...
@@ -0,0 +1,14 @@
1
+if (u=c) then
2
+											print "stimmt: "+L_code_array$(u) +"="+define_code$(c)
3
+											
4
+											DRAW SET "highColor", 100,0,0, "Canvas"
5
+											DRAW CIRCLE 175,450, 16, "Canvas"
6
+											stimmt=stimmt+1
7
+											//u=c+1
8
+											u=u+1
9
+											if (stimmt=4) then
10
+												print gewonnen
11
+											endif
12
+											
13
+											break
14
+										else	
0 15
\ No newline at end of file
1 16
new file mode 100755
... ...
@@ -0,0 +1,824 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+WorkDirectory()
4
+erstelle_Button()
5
+StartWindow()
6
+
7
+main()
8
+
9
+sub main()
10
+		
11
+	dim part$(1)
12
+	dim mesg$(1)
13
+	dim mouse$(1)
14
+	dim ViewMouse$(1)
15
+	inloop = true
16
+	while(inloop)
17
+		//Tastaturabfragen
18
+			keymsg$ = keyboard message$(Start_FensterName$) //
19
+		if(keymsg$<>"" and keymsg$<>old_keymsg$) then
20
+			//print keymsg$
21
+			old_keymsg$ = keymsg$
22
+		endif
23
+	
24
+		switch(keymsg$)
25
+		
26
+			default:
27
+			break
28
+		
29
+		end switch
30
+	
31
+		msg$ = message$
32
+		numSplit = split(msg$,mesg$(),"|")
33
+		for countMessages = 1 to numSplit
34
+			msg$ = mesg$(countMessages) + "|"
35
+			if (split(msg$, part$(), ":|") > 3) then
36
+				PartOne$=part$(1)
37
+				PartTwo$ = part$(2)
38
+				PartThree$ = part$(3)
39
+				PartFour$= part$(4)				
40
+			endif
41
+			if (msg$ <> "") print msg$
42
+			
43
+			switch (msg$)
44
+				case Start_FensterName$+":_QuitRequested|"
45
+					window close Start_FensterName$
46
+					break
47
+				case Start_FensterName$+":Programm:Quit|"
48
+				case Start_FensterName$+":Programm:Beenden|"
49
+					window close Start_FensterName$
50
+					break					
51
+				case "Restart|"
52
+					restart()
53
+				break		
54
+				case "Check|"
55
+					pruefen()
56
+				break
57
+				case "braun:ON|"
58
+					button_pressed$="braun"
59
+					CHECKBOX SET "blau", false						
60
+					CHECKBOX SET "gruen", false					
61
+					CHECKBOX SET "gelb", false						
62
+					CHECKBOX SET "rot",  false	
63
+					CHECKBOX SET "lila",  false				
64
+				break
65
+				case "braun:OFF|"	
66
+				break
67
+				case "rot:ON|"
68
+					button_pressed$="rot"
69
+					CHECKBOX SET "blau", false						
70
+					CHECKBOX SET "gruen", false					
71
+					CHECKBOX SET "gelb", false						
72
+					CHECKBOX SET "braun",  false	
73
+					CHECKBOX SET "lila",  false						
74
+				break
75
+				case "rot:OFF|"	
76
+				break
77
+				case "blau:ON|"
78
+					button_pressed$="blau"
79
+					CHECKBOX SET "braun", false						
80
+					CHECKBOX SET "gruen", false					
81
+					CHECKBOX SET "gelb", false						
82
+					CHECKBOX SET "rot",  false	
83
+					CHECKBOX SET "lila",  false				
84
+				break
85
+				case "blau:OFF|"	
86
+				break
87
+				case "lila:ON|"
88
+					button_pressed$="lila"
89
+					CHECKBOX SET "blau", false						
90
+					CHECKBOX SET "gruen", false					
91
+					CHECKBOX SET "gelb", false						
92
+					CHECKBOX SET "rot",  false	
93
+					CHECKBOX SET "braun",  false				
94
+					
95
+				break
96
+				case "lila:OFF|"	
97
+				break
98
+				case "gelb:ON|"
99
+					button_pressed$="gelb"
100
+					CHECKBOX SET "blau", false						
101
+					CHECKBOX SET "gruen", false					
102
+					CHECKBOX SET "braun", false						
103
+					CHECKBOX SET "rot",  false	
104
+					CHECKBOX SET "lila",  false				
105
+				break
106
+				case "gelb:OFF|"	
107
+				break
108
+				case "gruen:ON|"
109
+					button_pressed$="gruen"
110
+					CHECKBOX SET "blau", false						
111
+					CHECKBOX SET "gelb", false					
112
+					CHECKBOX SET "braun", false						
113
+					CHECKBOX SET "rot",  false	
114
+					CHECKBOX SET "lila",  false				
115
+				break
116
+				case "gruen:OFF|"	
117
+				break
118
+				case "Check:ON|"				
119
+					pruefen()
120
+					CHECKBOX SET "blau", false						
121
+					CHECKBOX SET "gruen", true					
122
+					CHECKBOX SET "braun", false						
123
+					CHECKBOX SET "rot",  false	
124
+					CHECKBOX SET "lila",  false	
125
+					CHECKBOX SET "gelb",  false				
126
+					CHECKBOX SET "Check", false
127
+					button_pressed$="gruen"
128
+					L_code_array$(0)=""
129
+					L_code_array$(1)=""
130
+					L_code_array$(2)=""
131
+					L_code_array$(3)=""						
132
+					alte_runde=runde
133
+				break
134
+				case "Restart:ON|"
135
+					restart()
136
+					CHECKBOX SET "blau", false						
137
+					CHECKBOX SET "gruen", true
138
+					button_pressed$="gruen"					
139
+					CHECKBOX SET "braun", false						
140
+					CHECKBOX SET "rot",  false	
141
+					CHECKBOX SET "lila",  false	
142
+					CHECKBOX SET "gelb",  false	
143
+				break
144
+				default:
145
+					
146
+				break
147
+			end switch
148
+		
149
+			if(window count<1) inloop = false
150
+			sleep 0.001
151
+		next countMessages
152
+		
153
+		//Mausabfragen
154
+		mmsg$ = MOUSE MESSAGE$
155
+		if (mmsg$<>"" and mmsg$<>old_mmsg$) then
156
+			//print mmsg$
157
+			old_mmsg$= mmsg$ 
158
+			n1 = split(mmsg$, mouse$(), ":")
159
+			Viewname$=mouse$(1)
160
+			
161
+			Xmouse	= val(mouse$(2))
162
+			Ymouse	= val(mouse$(3))
163
+			BLmouse	= val(mouse$(4))
164
+			BCmouse= val(mouse$(5))
165
+			BRmouse= val(mouse$(6))
166
+			casestring$=Viewname$+":"+mouse$(2)+":"+mouse$(3)+":"+mouse$(6)
167
+			mmsg$=""
168
+			print casestring$
169
+		endif
170
+		if (Xmouse>=0 and Ymouse<480-abstand_c and Xmouse<40 and Ymouse>440-abstand_c) then
171
+			if (BLmouse=1) then
172
+				if (button_pressed$="braun") then					
173
+					DRAW SET "highColor", 100,0,0, "Canvas"
174
+					L_code_array$(0)="braun"
175
+				endif
176
+				if (button_pressed$="gruen") then		
177
+					DRAW SET "highColor", 0,255,0, "Canvas"
178
+					L_code_array$(0)="gruen"
179
+				endif
180
+				if (button_pressed$="blau") then
181
+					DRAW SET "highColor", 0,0,255, "Canvas"
182
+					L_code_array$(0)="blau"
183
+				endif
184
+				if (button_pressed$="rot") then
185
+					DRAW SET "highColor", 255,0,0, "Canvas"
186
+					L_code_array$(0)="rot"
187
+				endif
188
+				if (button_pressed$="gelb") then	
189
+					DRAW SET "highColor", 255,204,0, "Canvas"
190
+					L_code_array$(0)="gelb"
191
+				endif
192
+				if (button_pressed$="lila") then
193
+					DRAW SET "highColor", 155,0,255, "Canvas"
194
+					L_code_array$(0)="lila"
195
+				endif
196
+				DRAW CIRCLE 20,460-abstand_c, 16, "Canvas"
197
+			endif 
198
+			wait 0.2
199
+		endif
200
+		if (Xmouse>=41 and Ymouse<480-abstand_c and Xmouse<=79 and Ymouse>440-abstand_c) then
201
+			if (BLmouse=1) then
202
+				if (button_pressed$="braun") then					
203
+					DRAW SET "highColor", 100,0,0, "Canvas"
204
+					L_code_array$(1)="braun"
205
+				endif
206
+				if (button_pressed$="gruen") then		
207
+					DRAW SET "highColor", 0,255,0, "Canvas"
208
+					L_code_array$(1)="gruen"
209
+				endif
210
+				if (button_pressed$="blau") then
211
+					DRAW SET "highColor", 0,0,255, "Canvas"
212
+					L_code_array$(1)="blau"
213
+				endif
214
+				if (button_pressed$="rot") then
215
+					DRAW SET "highColor", 255,0,0, "Canvas"
216
+					L_code_array$(1)="rot"
217
+				endif
218
+				if (button_pressed$="gelb") then	
219
+					DRAW SET "highColor", 255,204,0, "Canvas"
220
+					L_code_array$(1)="gelb"
221
+				endif
222
+				if (button_pressed$="lila") then
223
+					DRAW SET "highColor", 155,0,255, "Canvas"
224
+					L_code_array$(1)="lila"
225
+				endif
226
+				DRAW CIRCLE 60,460-abstand_c, 16, "Canvas"
227
+			endif 
228
+			wait 0.2
229
+		endif
230
+		if (Xmouse>=81 and Ymouse<480-abstand_c and Xmouse<=119 and Ymouse>440-abstand_c) then
231
+		 	if (BLmouse=1) then
232
+				if (button_pressed$="braun") then					
233
+					DRAW SET "highColor", 100,0,0, "Canvas"
234
+					L_code_array$(2)="braun"
235
+				endif
236
+				if (button_pressed$="gruen") then		
237
+					DRAW SET "highColor", 0,255,0, "Canvas"
238
+					L_code_array$(2)="gruen"
239
+				endif
240
+				if (button_pressed$="blau") then
241
+					DRAW SET "highColor", 0,0,255, "Canvas"
242
+					L_code_array$(2)="blau"
243
+				endif
244
+				if (button_pressed$="rot") then
245
+					DRAW SET "highColor", 255,0,0, "Canvas"
246
+					L_code_array$(2)="rot"
247
+				endif
248
+				if (button_pressed$="gelb") then	
249
+					DRAW SET "highColor", 255,204,0, "Canvas"
250
+					L_code_array$(2)="gelb"
251
+				endif
252
+				if (button_pressed$="lila") then
253
+					DRAW SET "highColor", 155,0,255, "Canvas"	
254
+					L_code_array$(2)="lila"					
255
+				endif
256
+				DRAW CIRCLE 100,460-abstand_c, 16, "Canvas"
257
+			endif 
258
+			wait 0.2
259
+		endif
260
+		if (Xmouse>=121 and Ymouse<480-abstand_c and Xmouse<=169 and Ymouse>440-abstand_c) then
261
+		 	if (BLmouse=1) then
262
+				if (button_pressed$="braun") then					
263
+					DRAW SET "highColor", 100,0,0, "Canvas"
264
+					L_code_array$(3)="braun"
265
+				endif
266
+				if (button_pressed$="gruen") then		
267
+					DRAW SET "highColor", 0,255,0, "Canvas"
268
+					L_code_array$(3)="gruen"
269
+				endif
270
+				if (button_pressed$="blau") then
271
+					DRAW SET "highColor", 0,0,255, "Canvas"
272
+					L_code_array$(3)="blau"
273
+				endif
274
+				if (button_pressed$="rot") then
275
+					DRAW SET "highColor", 255,0,0, "Canvas"
276
+					L_code_array$(3)="rot"
277
+				endif
278
+				if (button_pressed$="gelb") then	
279
+					DRAW SET "highColor", 255,204,0, "Canvas"
280
+					L_code_array$(3)="gelb"
281
+				endif
282
+				if (button_pressed$="lila") then
283
+					DRAW SET "highColor", 155,0,255, "Canvas"
284
+					L_code_array$(3)="lila"
285
+				endif
286
+				DRAW CIRCLE 140,460-abstand_c, 16, "Canvas"
287
+			endif 
288
+			wait 0.2
289
+		endif
290
+			
291
+		switch (casestring$)
292
+			default:
293
+				//print L_code_array$(0)+L_code_array$(1)+L_code_array$(2)+L_code_array$(3)
294
+				if (L_code_array$(0)="" or L_code_array$(1)="" or L_code_array$(2)="" or L_code_array$(3)="") then
295
+					option set "Check","Enabled", 0
296
+					wait 0.2 
297
+				else
298
+					option set "Check","Enabled", 1
299
+					wait 0.2
300
+				endif
301
+			break
302
+		end switch
303
+	wend
304
+end sub
305
+sub WorkDirectory()
306
+REM ######Verzeichnis bestimmen######
307
+
308
+	//if (peek("isbound")) then
309
+	//WorkDir$ = peek$("directory")
310
+	//else
311
+	//WorkDir$ = system$("pwd")
312
+	//WorkDir$ = left$(WorkDir$, len(WorkDir$)-1)
313
+	//fi
314
+	gfx$="/Share/Projekte/yab/mastermind/gfx"
315
+
316
+end sub
317
+
318
+Sub StartWindow()
319
+REM ######Startvariable ######
320
+	alt_runde=0
321
+	dim L_code_array$(4)
322
+	
323
+	ProgrammName$="Find the code"
324
+	Start_FensterName$="FTC"
325
+	NameView$="Untergrund"
326
+	
327
+REM ######Fensteraufbau######
328
+	
329
+	screenWidth = peek("desktopwidth")
330
+	screenHeight = peek("desktopheight")
331
+	WindowSize_x=350
332
+	WindowSize_y=550
333
+	
334
+	window open ((screenWidth/2)-(WindowSize_1/2)), ((screenHeight/2)-(WindowSize_y/2)) to ((screenWidth/2)+(WindowSize_1/2)), ((screenHeight/2)+(WindowSize_y/2)), Start_FensterName$,ProgrammName$
335
+	window set  Start_FensterName$, "MinimumTo", WindowSize_x,WindowSize_y
336
+	window set  Start_FensterName$, "MaximumTo", WindowSize_x,WindowSize_y
337
+	
338
+	View 0,20 to WindowSize_x, WindowSize_y, NameView$, Start_FensterName$
339
+	
340
+	CHECKBOX image WindowSize_x-50,0, "Restart", gfx$+"/refresh_rot.png", gfx$+"/refresh_grau.png", gfx$+"/refresh_grau.png","",false, NameView$
341
+	CHECKBOX image WindowSize_x-50,50, "Check", gfx$+"/check_gelb.png", gfx$+"/check_grau.png", gfx$+"/check_gelb.png","",false, NameView$
342
+		
343
+	option set Start_FensterName$, "focus", true
344
+	
345
+	canvas 40,0 to  WindowSize_x-60, WindowSize_y-70,"Canvas", NameView$
346
+	generiere_canvas()
347
+	erstelle_Code()
348
+	auswahl_farbe()
349
+	
350
+end sub
351
+
352
+sub erstelle_Code()	
353
+REM #### erstelle Code (Computer) ####
354
+REM #### 6 Farben aus denen 4 Farben ausgewählt werden können. ####
355
+REM #### 4 können ausgewählt werden, alle können mehrmals vorkommen. ####	
356
+REM #### Variablen ####
357
+	
358
+	local i
359
+	local x
360
+	
361
+	gruen=0
362
+	braun=0
363
+	lila=0
364
+	rot=0
365
+	blau=0
366
+	gelb=0
367
+	abstand=0
368
+	
369
+REM #### Arrays für den Code erstellen ####
370
+
371
+	dim define_code$(3)
372
+
373
+REM #### Farbarray erstellen, aus dem die Farben per Zufall ausgewählt werden ####
374
+
375
+	dim code_array$(5)
376
+
377
+REM #### Befüllung Farbarray mit den verfügbaren Farben
378
+
379
+	code_array$(0)="gruen"
380
+	code_array$(1)="blau"
381
+	code_array$(2)="rot"
382
+	code_array$(3)="gelb"
383
+	code_array$(4)="lila"
384
+	code_array$(5)="braun"
385
+REM #### Highcolor ändern ####
386
+	
387
+	DRAW SET false, "HighSolidFill"
388
+
389
+REM #### Zufalllsgenerator, auswahl Farbarray und Zuweisung zu dem Codearray, sowie malen auf der Canvas  
390
+	
391
+	for i=0 to 3
392
+		x=int(ran(6))
393
+		//print x
394
+		if (code_array$(x)="gruen") then		
395
+			DRAW SET "highColor", 0,255,0, "Canvas"
396
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
397
+			define_code$(i)="gruen"
398
+			gruen=gruen+1
399
+		elseif (code_array$(x)="blau") then
400
+			DRAW SET "highColor", 0,0,255, "Canvas"
401
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
402
+			define_code$(i)="blau"	
403
+			blau=blau+1		
404
+		elseif (code_array$(x)="rot") then
405
+			DRAW SET "highColor", 255,0,0, "Canvas"
406
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
407
+			define_code$(i)="rot"		
408
+			rot=rot+1	
409
+		elseif (code_array$(x)="gelb") then
410
+			DRAW SET "highColor", 255,204,0, "Canvas"
411
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
412
+			define_code$(i)="gelb"
413
+			gelb=gelb+1			
414
+		elseif (code_array$(x)="lila") then
415
+			DRAW SET "highColor", 155,0,255, "Canvas"
416
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
417
+			define_code$(i)="lila"
418
+			lila=lila+1
419
+		elseif (code_array$(x)="braun") then
420
+			DRAW SET "highColor", 100,0,0, "Canvas"
421
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
422
+			define_code$(i)="braun"
423
+			braun=braun+1
424
+		endif
425
+		wait 0.1
426
+		abstand=abstand+40
427
+	next i
428
+	
429
+end sub
430
+
431
+sub auswahl_farbe()
432
+REM ### Erstellen der Checkboxen zur Auswahl der Farben vom Spieler
433
+		
434
+	CHECKBOX image WindowSize_x-50,240, "gruen", gfx$+"/gruen_pressed.png", gfx$+"/gruen.png", "","",true, NameView$
435
+	CHECKBOX image WindowSize_x-50,280, "rot", gfx$+"/rot_pressed.png", gfx$+"/rot.png", "", "",false,NameView$
436
+	CHECKBOX image WindowSize_x-50,320, "blau", gfx$+"/blau_pressed.png", gfx$+"/blau.png", "", "",false,NameView$
437
+	CHECKBOX image WindowSize_x-50,360, "gelb", gfx$+"/gelb_pressed.png", gfx$+"/gelb.png", "", "",false,NameView$
438
+	CHECKBOX image WindowSize_x-50,400, "lila", gfx$+"/lila_pressed.png", gfx$+"/lila.png", "", "",false,NameView$
439
+	CHECKBOX image WindowSize_x-50,440, "braun", gfx$+"/braun_pressed.png", gfx$+"/braun.png", "", "",false,NameView$
440
+
441
+end sub
442
+
443
+sub generiere_canvas()
444
+REM #### Erstelle Canvas (Spielfeld) ####
445
+REM #### Variablen erstellen ####
446
+	
447
+	local i,d,a,b,e,p,o
448
+	i=0:d=0:a=0:b=0:e=0:p=0:o=0
449
+	
450
+REM #### Malfarbe anpassen
451
+	
452
+	DRAW SET "highColor", 0,0,0, "Canvas"
453
+	DRAW SET true, "HighSolidFill"
454
+	
455
+REM #### Rechteckmuster erstellen ####
456
+
457
+	for i=1 to 4
458
+		for d=1 to 12
459
+			draw rect 0*i,0*d to 40*i,40*d ,"Canvas"
460
+		next d
461
+	next i
462
+	
463
+REM #### Entfernen der zuviel gemalten Linien ####
464
+REM #### Anpassen der Malfarbe und zurücksetzen der Malfarbe ####
465
+
466
+	DRAW SET "highColor", 255,255,255, "Canvas"
467
+	DRAW SET FALSE, "HighSolidFill"
468
+	DRAW RECT 1,41 TO 159,79, "Canvas"
469
+	DRAW SET "highColor", 0,0,0, "Canvas"
470
+	DRAW SET true, "HighSolidFill"
471
+
472
+REM #### An der Seite die Runde schreiben ####
473
+
474
+	for a=1 to 10
475
+		if (a<10) then
476
+			text$="0"+str$(a)
477
+		else
478
+			text$=str$(a)
479
+		endif
480
+		draw text 5,460-b, "R "+text$, NameView$
481
+		b=b+39.5	 
482
+	next a
483
+
484
+REM #### Linke Seite die Löcher für die Hinweisstifte malen
485
+
486
+	start_y2=90
487
+	for i = 1 to 4
488
+		for o=1 to 20
489
+			DRAW SET "highColor", 125,125,125, "Canvas"
490
+			DRAW CIRCLE 175+e,start_y2+p, 6, "Canvas"  //male hinweis
491
+			p=p+20
492
+		next o
493
+		p=0
494
+		e=e+20
495
+	next i
496
+
497
+end sub
498
+
499
+sub gewonnen()
500
+	TEXTURL 10,500, "update", "link", "http://www.besly.de/test.php", NameView$
501
+
502
+end sub
503
+
504
+sub runde_markieren(runde)
505
+REM #### Rundenmarkierung auf der Rechten Seite malen ####
506
+REM #### Startvariablen erstellen, Malfarbe anpassen und zurücksetzen ####
507
+
508
+	local i
509
+	local y
510
+	starty=470
511
+	starty=480
512
+	y=0
513
+	
514
+	DRAW SET "highColor", 5,255,5, NameView$
515
+	DRAW SET false, "HighSolidFill"
516
+	for i=1 to runde		
517
+		draw rect 5,470-y to 35,480-y ,NameView$
518
+		y=y+39
519
+	next i
520
+	DRAW SET "highColor", 0,0,0, NameView$
521
+	
522
+end sub
523
+
524
+sub restart()
525
+REM #### alles auf Null zurücksetzen
526
+
527
+	DRAW SET "highColor", 255,255,255, "Canvas"
528
+	DRAW SET FALSE, "HighSolidFill"
529
+	DRAW RECT 0,0 TO 290,480, "Canvas"
530
+	DRAW SET "highcolor", 0,0,0, "Canvas"
531
+	DRAW SET true, "HighSolidFill"
532
+
533
+	DRAW SET FALSE, "HighSolidFill"
534
+	DRAW SET "highColor", 216,216,216, NameView$
535
+	DRAW RECT 0,0 to 40,480,NameView$
536
+	DRAW SET "highColor", 0,0,0, NameView$
537
+	DRAW SET true, "HighSolidFill"
538
+
539
+	L_code_array$(0)=""
540
+	L_code_array$(1)=""
541
+	L_code_array$(2)=""
542
+	L_code_array$(3)=""	
543
+	runde=0
544
+	alt_runde=0
545
+	erstelle_Code()
546
+	generiere_canvas()
547
+	runde_markieren(runde)
548
+
549
+end sub
550
+
551
+sub pruefen()
552
+
553
+	dim stimmt_array(3)	 					
554
+	if (runde=10) then
555
+	 	print "game_over"
556
+	else								
557
+		abstand_c=abstand_c+40
558
+		runde=runde+1
559
+		stimmt=0
560
+		u=0
561
+		c=0
562
+		x=0
563
+		t=0
564
+		e=0
565
+		l_gruen=0
566
+		l_blau=0
567
+		l_rot=0
568
+		l_braun=0
569
+		l_gelb=0
570
+		l_lila=0
571
+		if (runde=1) then
572
+			start_y1=472
573
+			start_y2=450
574
+		else
575
+			start_y1=start_y1-40
576
+			//print start_y1
577
+			start_y2=start_y2-40
578
+			//print start_y2
579
+		endif
580
+			
581
+		for b=0 to 3
582
+			stimmt_array(b)=0
583
+			//print stimmt_array(b)
584
+		next b
585
+	
586
+		
587
+	
588
+		// Ermittlung wieviele Farben und die Anzahl der einzelnen Farben der Code enthält			
589
+		for m=0 to 3
590
+			if(L_code_array$(m)="gruen") then
591
+				l_gruen=l_gruen+1
592
+				print l_gruen
593
+				wait 0.1
594
+			endif
595
+			if(L_code_array$(m)="blau") then
596
+				l_blau=l_blau+1
597
+				print l_blau
598
+				wait 0.1
599
+			endif
600
+			if(L_code_array$(m)="rot") then
601
+				l_rot=l_rot+1
602
+				print l_rot
603
+				wait 0.1
604
+			endif
605
+			if(L_code_array$(m)="gelb") then
606
+				l_gelb=l_gelb+1
607
+				print l_gelb
608
+				wait 0.1
609
+			endif
610
+			if(L_code_array$(m)="braun") then
611
+				l_braun=l_braun+1
612
+				print l_braun
613
+				wait 0.1
614
+			endif
615
+			if(L_code_array$(m)="lila") then
616
+				l_lila=l_lila+1
617
+				print l_lila
618
+				wait 0.1
619
+			endif
620
+		next m	
621
+		nenner_ok=0
622
+		if(gruen >= l_gruen) then
623
+			nenner_ok=nenner_ok+l_gruen
624
+		endif
625
+		if(gruen < l_gruen) then
626
+			nenner_ok=nenner_ok+gruen
627
+		endif
628
+		if(blau >= l_blau) then
629
+			nenner_ok=nenner_ok+l_blau
630
+		endif
631
+		if(blau < l_blau) then
632
+			nenner_ok=nenner_ok+blau
633
+		endif
634
+		if(gelb >= l_gelb) then
635
+			nenner_ok=nenner_ok+l_gelb
636
+		endif
637
+		if(gelb < l_gelb) then
638
+			nenner_ok=nenner_ok+l_gelb
639
+		endif
640
+		if(lila >= l_lila) then
641
+			nenner_ok=nenner_ok+l_lila
642
+		endif
643
+		if(lila < l_lila) then
644
+			nenner_ok=nenner_ok+lila
645
+		endif
646
+		if(rot >= l_rot) then
647
+			nenner_ok=nenner_ok+l_rot
648
+		endif
649
+		if(rot < l_rot) then
650
+			nenner_ok=nenner_ok+rot
651
+		endif
652
+		if(braun >= l_braun) then
653
+			nenner_ok=nenner_ok+l_braun
654
+		endif
655
+		if(braun < l_braun) then
656
+			nenner_ok=nenner_ok+braun
657
+		endif
658
+		
659
+		//Überprüfung auf Volltreffer
660
+		for u=0 to 3  
661
+			if (L_code_array$(u)=define_code$(u)) then
662
+				if(L_code_array$(u)="gruen") then
663
+					nenner_ok=nenner_ok-1
664
+					stimmt_array(u)=2					
665
+				endif
666
+				
667
+				if(L_code_array$(u)="rot") then
668
+					nenner_ok=nenner_ok-1
669
+					stimmt_array(u)=2
670
+					
671
+				endif
672
+				if(L_code_array$(u)="gelb") then
673
+					nenner_ok=nenner_ok-1
674
+					stimmt_array(u)=2
675
+					
676
+				endif
677
+				if(L_code_array$(u)="blau") then
678
+					nenner_ok=nenner_ok-1
679
+					stimmt_array(u)=2
680
+					
681
+				endif
682
+				if(L_code_array$(u)="braun") then
683
+					nenner_ok=nenner_ok-1
684
+					stimmt_array(u)=2
685
+					
686
+				endif
687
+				if(L_code_array$(u)="lila") then
688
+					nenner_ok=nenner_ok-1
689
+					stimmt_array(u)=2
690
+					
691
+				endif
692
+			else
693
+				stimmt_array(u)=0	
694
+			endif							
695
+		next u
696
+			
697
+		//überprüfung auf Farbe richtig, aber nicht an der richtigen Stelle
698
+		//erste Schleife für den durchlauf welche noch nicht als volltreffer deklariert sind
699
+		
700
+		print "+++++++++++++++"
701
+		print "l_gruen:"+str$(l_gruen)+"|gruen:"+str$(gruen)
702
+		print "l_blau:"+str$(l_blau)+"|blau:"+str$(blau)
703
+		print "l_braun:"+str$(l_braun)+"|braun:"+str$(braun)
704
+		print "l_gelb:"+str$(l_gelb)+"|gelb:"+str$(gelb)
705
+		print "l_rot:"+str$(l_rot)+"|rot:"+str$(rot)
706
+		print "l_lila:"+str$(l_lila)+"|lila:"+str$(lila)
707
+		print "nenner_ok:"+str$(nenner_ok)
708
+		print "+++++++++++++++"
709
+		
710
+		hr=0
711
+		for ho=1 to nenner_ok
712
+			DRAW SET "highColor", 125,125,125, "Canvas"
713
+			DRAW CIRCLE 175+hr,start_y2, 6, "Canvas"  //male hinweis	
714
+			hr=hr+20
715
+		next ho
716
+			
717
+		r=0
718
+		for o=0 to 3
719
+			if(stimmt_array(o)=2) then
720
+				DRAW SET "highColor", 255,125,125, "Canvas"
721
+				DRAW CIRCLE 175+r,start_y1, 6, "Canvas"
722
+			endif
723
+			r=r+20
724
+		next o
725
+		// überprüfung ob alle ein Volltreffer sind.
726
+		for q=0 to 3
727
+			stimmt_array1=stimmt_array1+stimmt_array(q)
728
+			print "stimmt_array :  "+str$(stimmt_array(q))
729
+			if(stimmt_array1=8) then
730
+				gewonnen()
731
+			endif
732
+		next q
733
+		
734
+	endif
735
+	runde_markieren(runde)
736
+end sub
737
+
738
+sub erstelle_Button()
739
+REM #### Erstelle Button beim Starten und speichere Diese im Verzeichnis
740
+
741
+	ID_Button$="Buttons"
742
+	Bitmap 41,41, ID_Button$
743
+	
744
+	DRAW SET "highColor", 0,255,0, ID_Button$
745
+	DRAW CIRCLE 20,20, 16, ID_Button$
746
+	BITMAP GET 0,0 to 40,40, "save1", ID_Button$
747
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gruen.png", "png"	
748
+				
749
+	DRAW SET "highColor", 0,0,255, ID_Button$
750
+	DRAW CIRCLE 20,20, 16, ID_Button$
751
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
752
+	ErrCode = BITMAP SAVE "save1", gfx$+"/blau.png", "png"		
753
+		
754
+	DRAW SET "highColor", 255,0,0, ID_Button$
755
+	DRAW CIRCLE 20,20, 16, ID_Button$
756
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
757
+	ErrCode = BITMAP SAVE "save1", gfx$+"/rot.png", "png"			
758
+		
759
+	DRAW SET "highColor", 255,204,0, ID_Button$
760
+	DRAW CIRCLE 20,20, 16, ID_Button$
761
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
762
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gelb.png", "png"
763
+		
764
+	DRAW SET "highColor", 155,0,255,ID_Button$
765
+	DRAW CIRCLE 20,20, 16, ID_Button$
766
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
767
+	ErrCode = BITMAP SAVE "save1", gfx$+"/lila.png", "png"
768
+		
769
+	DRAW SET "highColor", 100,0,0, ID_Button$
770
+	DRAW CIRCLE 20,20, 16, ID_Button$
771
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
772
+	ErrCode = BITMAP SAVE "save1", gfx$+"/braun.png", "png"	
773
+	
774
+	
775
+	// gedrückte Buttons
776
+	DRAW SET "highColor", 0,255,0, ID_Button$
777
+	DRAW CIRCLE 20,20, 16, ID_Button$
778
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
779
+	DRAW SET 0, "HighSolidFill"	
780
+	draw rect 0,35 to 40,40 ,ID_Button$
781
+	BITMAP GET 0,0 to 40,40, "save1", ID_Button$
782
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gruen_pressed.png", "png"	
783
+					
784
+	DRAW SET "highColor", 0,0,255, ID_Button$
785
+	DRAW CIRCLE 20,20, 16, ID_Button$
786
+	DRAW SET 0, "HighSolidFill"
787
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
788
+	draw rect 0,35 to 40,40 ,ID_Button$
789
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
790
+	ErrCode = BITMAP SAVE "save1", gfx$+"/blau_pressed.png", "png"		
791
+		
792
+	DRAW SET "highColor", 255,0,0, ID_Button$
793
+	DRAW CIRCLE 20,20, 16, ID_Button$
794
+	DRAW SET 0, "HighSolidFill"
795
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
796
+	draw rect 0,35 to 40,40 ,ID_Button$
797
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
798
+	ErrCode = BITMAP SAVE "save1", gfx$+"/rot_pressed.png", "png"			
799
+		
800
+	DRAW SET "highColor", 255,204,0, ID_Button$
801
+	DRAW CIRCLE 20,20, 16, ID_Button$
802
+	DRAW SET 0, "HighSolidFill"
803
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
804
+	draw rect 0,35 to 40,40 ,ID_Button$
805
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
806
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gelb_pressed.png", "png"
807
+		
808
+	DRAW SET "highColor", 155,0,255,ID_Button$
809
+	DRAW CIRCLE 20,20, 16, ID_Button$
810
+	DRAW SET 0, "HighSolidFill"
811
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
812
+	draw rect 0,35 to 40,40 ,ID_Button$
813
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
814
+	ErrCode = BITMAP SAVE "save1", gfx$+"/lila_pressed.png", "png"
815
+		
816
+	DRAW SET "highColor", 100,0,0, ID_Button$
817
+	DRAW CIRCLE 20,20, 16, ID_Button$
818
+	DRAW SET 0, "HighSolidFill"
819
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
820
+	draw rect 0,35 to 40,40 ,ID_Button$
821
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
822
+	ErrCode = BITMAP SAVE "save1", gfx$+"/braun_pressed.png", "png"	
823
+		
824
+end sub
0 825
new file mode 100755
... ...
@@ -0,0 +1,832 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+WorkDirectory()
4
+erstelle_Button()
5
+StartWindow()
6
+
7
+main()
8
+
9
+sub main()
10
+		
11
+	dim part$(1)
12
+	dim mesg$(1)
13
+	dim mouse$(1)
14
+	dim ViewMouse$(1)
15
+	inloop = true
16
+	while(inloop)
17
+		//Tastaturabfragen
18
+			keymsg$ = keyboard message$(Start_FensterName$) //
19
+		if(keymsg$<>"" and keymsg$<>old_keymsg$) then
20
+			//print keymsg$
21
+			old_keymsg$ = keymsg$
22
+		endif
23
+	
24
+		switch(keymsg$)
25
+		
26
+			default:
27
+			break
28
+		
29
+		end switch
30
+	
31
+		msg$ = message$
32
+		numSplit = split(msg$,mesg$(),"|")
33
+		for countMessages = 1 to numSplit
34
+			msg$ = mesg$(countMessages) + "|"
35
+			if (split(msg$, part$(), ":|") > 3) then
36
+				PartOne$=part$(1)
37
+				PartTwo$ = part$(2)
38
+				PartThree$ = part$(3)
39
+				PartFour$= part$(4)				
40
+			endif
41
+			if (msg$ <> "") print msg$
42
+			
43
+			switch (msg$)
44
+				case Start_FensterName$+":_QuitRequested|"
45
+					window close Start_FensterName$
46
+					break
47
+				case Start_FensterName$+":Programm:Quit|"
48
+				case Start_FensterName$+":Programm:Beenden|"
49
+					window close Start_FensterName$
50
+					break					
51
+				case "Restart|"
52
+					restart()
53
+				break		
54
+				case "Check|"
55
+					pruefen()
56
+				break
57
+				case "braun:ON|"
58
+					button_pressed$="braun"
59
+					CHECKBOX SET "blau", false						
60
+					CHECKBOX SET "gruen", false					
61
+					CHECKBOX SET "gelb", false						
62
+					CHECKBOX SET "rot",  false	
63
+					CHECKBOX SET "lila",  false				
64
+				break
65
+				case "braun:OFF|"	
66
+				break
67
+				case "rot:ON|"
68
+					button_pressed$="rot"
69
+					CHECKBOX SET "blau", false						
70
+					CHECKBOX SET "gruen", false					
71
+					CHECKBOX SET "gelb", false						
72
+					CHECKBOX SET "braun",  false	
73
+					CHECKBOX SET "lila",  false						
74
+				break
75
+				case "rot:OFF|"	
76
+				break
77
+				case "blau:ON|"
78
+					button_pressed$="blau"
79
+					CHECKBOX SET "braun", false						
80
+					CHECKBOX SET "gruen", false					
81
+					CHECKBOX SET "gelb", false						
82
+					CHECKBOX SET "rot",  false	
83
+					CHECKBOX SET "lila",  false				
84
+				break
85
+				case "blau:OFF|"	
86
+				break
87
+				case "lila:ON|"
88
+					button_pressed$="lila"
89
+					CHECKBOX SET "blau", false						
90
+					CHECKBOX SET "gruen", false					
91
+					CHECKBOX SET "gelb", false						
92
+					CHECKBOX SET "rot",  false	
93
+					CHECKBOX SET "braun",  false				
94
+					
95
+				break
96
+				case "lila:OFF|"	
97
+				break
98
+				case "gelb:ON|"
99
+					button_pressed$="gelb"
100
+					CHECKBOX SET "blau", false						
101
+					CHECKBOX SET "gruen", false					
102
+					CHECKBOX SET "braun", false						
103
+					CHECKBOX SET "rot",  false	
104
+					CHECKBOX SET "lila",  false				
105
+				break
106
+				case "gelb:OFF|"	
107
+				break
108
+				case "gruen:ON|"
109
+					button_pressed$="gruen"
110
+					CHECKBOX SET "blau", false						
111
+					CHECKBOX SET "gelb", false					
112
+					CHECKBOX SET "braun", false						
113
+					CHECKBOX SET "rot",  false	
114
+					CHECKBOX SET "lila",  false				
115
+				break
116
+				case "gruen:OFF|"	
117
+				break
118
+				case "Check:ON|"				
119
+					pruefen()
120
+					CHECKBOX SET "blau", false						
121
+					CHECKBOX SET "gruen", true					
122
+					CHECKBOX SET "braun", false						
123
+					CHECKBOX SET "rot",  false	
124
+					CHECKBOX SET "lila",  false	
125
+					CHECKBOX SET "gelb",  false				
126
+					CHECKBOX SET "Check", false
127
+					button_pressed$="gruen"
128
+					L_code_array$(0)=""
129
+					L_code_array$(1)=""
130
+					L_code_array$(2)=""
131
+					L_code_array$(3)=""						
132
+					alte_runde=runde
133
+				break
134
+				case "Restart:ON|"
135
+					abstand_c=0
136
+					restart()
137
+					CHECKBOX SET "blau", false						
138
+					CHECKBOX SET "gruen", true									
139
+					CHECKBOX SET "braun", false						
140
+					CHECKBOX SET "rot",  false	
141
+					CHECKBOX SET "lila",  false	
142
+					CHECKBOX SET "gelb",  false	
143
+					button_pressed$="gruen"	
144
+				break
145
+				default:
146
+					
147
+				break
148
+			end switch
149
+		
150
+			if(window count<1) inloop = false
151
+			sleep 0.001
152
+		next countMessages
153
+		
154
+		//Mausabfragen
155
+		mmsg$ = MOUSE MESSAGE$
156
+		if (mmsg$<>"" and mmsg$<>old_mmsg$) then
157
+			//print mmsg$
158
+			old_mmsg$= mmsg$ 
159
+			n1 = split(mmsg$, mouse$(), ":")
160
+			Viewname$=mouse$(1)
161
+			
162
+			Xmouse	= val(mouse$(2))
163
+			Ymouse	= val(mouse$(3))
164
+			BLmouse	= val(mouse$(4))
165
+			BCmouse= val(mouse$(5))
166
+			BRmouse= val(mouse$(6))
167
+			casestring$=Viewname$+":"+mouse$(2)+":"+mouse$(3)+":"+mouse$(6)
168
+			mmsg$=""
169
+			print casestring$
170
+		endif
171
+		if (Xmouse>=0 and Ymouse<480-abstand_c and Xmouse<40 and Ymouse>440-abstand_c) then
172
+			if (BLmouse=1) then
173
+				if (button_pressed$="braun") then					
174
+					DRAW SET "highColor", 100,0,0, "Canvas"
175
+					L_code_array$(0)="braun"
176
+				endif
177
+				if (button_pressed$="gruen") then		
178
+					DRAW SET "highColor", 0,255,0, "Canvas"
179
+					L_code_array$(0)="gruen"
180
+				endif
181
+				if (button_pressed$="blau") then
182
+					DRAW SET "highColor", 0,0,255, "Canvas"
183
+					L_code_array$(0)="blau"
184
+				endif
185
+				if (button_pressed$="rot") then
186
+					DRAW SET "highColor", 255,0,0, "Canvas"
187
+					L_code_array$(0)="rot"
188
+				endif
189
+				if (button_pressed$="gelb") then	
190
+					DRAW SET "highColor", 255,204,0, "Canvas"
191
+					L_code_array$(0)="gelb"
192
+				endif
193
+				if (button_pressed$="lila") then
194
+					DRAW SET "highColor", 155,0,255, "Canvas"
195
+					L_code_array$(0)="lila"
196
+				endif
197
+				DRAW CIRCLE 20,460-abstand_c, 16, "Canvas"
198
+			endif 
199
+			wait 0.2
200
+		endif
201
+		if (Xmouse>=41 and Ymouse<480-abstand_c and Xmouse<=79 and Ymouse>440-abstand_c) then
202
+			if (BLmouse=1) then
203
+				if (button_pressed$="braun") then					
204
+					DRAW SET "highColor", 100,0,0, "Canvas"
205
+					L_code_array$(1)="braun"
206
+				endif
207
+				if (button_pressed$="gruen") then		
208
+					DRAW SET "highColor", 0,255,0, "Canvas"
209
+					L_code_array$(1)="gruen"
210
+				endif
211
+				if (button_pressed$="blau") then
212
+					DRAW SET "highColor", 0,0,255, "Canvas"
213
+					L_code_array$(1)="blau"
214
+				endif
215
+				if (button_pressed$="rot") then
216
+					DRAW SET "highColor", 255,0,0, "Canvas"
217
+					L_code_array$(1)="rot"
218
+				endif
219
+				if (button_pressed$="gelb") then	
220
+					DRAW SET "highColor", 255,204,0, "Canvas"
221
+					L_code_array$(1)="gelb"
222
+				endif
223
+				if (button_pressed$="lila") then
224
+					DRAW SET "highColor", 155,0,255, "Canvas"
225
+					L_code_array$(1)="lila"
226
+				endif
227
+				DRAW CIRCLE 60,460-abstand_c, 16, "Canvas"
228
+			endif 
229
+			wait 0.2
230
+		endif
231
+		if (Xmouse>=81 and Ymouse<480-abstand_c and Xmouse<=119 and Ymouse>440-abstand_c) then
232
+		 	if (BLmouse=1) then
233
+				if (button_pressed$="braun") then					
234
+					DRAW SET "highColor", 100,0,0, "Canvas"
235
+					L_code_array$(2)="braun"
236
+				endif
237
+				if (button_pressed$="gruen") then		
238
+					DRAW SET "highColor", 0,255,0, "Canvas"
239
+					L_code_array$(2)="gruen"
240
+				endif
241
+				if (button_pressed$="blau") then
242
+					DRAW SET "highColor", 0,0,255, "Canvas"
243
+					L_code_array$(2)="blau"
244
+				endif
245
+				if (button_pressed$="rot") then
246
+					DRAW SET "highColor", 255,0,0, "Canvas"
247
+					L_code_array$(2)="rot"
248
+				endif
249
+				if (button_pressed$="gelb") then	
250
+					DRAW SET "highColor", 255,204,0, "Canvas"
251
+					L_code_array$(2)="gelb"
252
+				endif
253
+				if (button_pressed$="lila") then
254
+					DRAW SET "highColor", 155,0,255, "Canvas"	
255
+					L_code_array$(2)="lila"					
256
+				endif
257
+				DRAW CIRCLE 100,460-abstand_c, 16, "Canvas"
258
+			endif 
259
+			wait 0.2
260
+		endif
261
+		if (Xmouse>=121 and Ymouse<480-abstand_c and Xmouse<=169 and Ymouse>440-abstand_c) then
262
+		 	if (BLmouse=1) then
263
+				if (button_pressed$="braun") then					
264
+					DRAW SET "highColor", 100,0,0, "Canvas"
265
+					L_code_array$(3)="braun"
266
+				endif
267
+				if (button_pressed$="gruen") then		
268
+					DRAW SET "highColor", 0,255,0, "Canvas"
269
+					L_code_array$(3)="gruen"
270
+				endif
271
+				if (button_pressed$="blau") then
272
+					DRAW SET "highColor", 0,0,255, "Canvas"
273
+					L_code_array$(3)="blau"
274
+				endif
275
+				if (button_pressed$="rot") then
276
+					DRAW SET "highColor", 255,0,0, "Canvas"
277
+					L_code_array$(3)="rot"
278
+				endif
279
+				if (button_pressed$="gelb") then	
280
+					DRAW SET "highColor", 255,204,0, "Canvas"
281
+					L_code_array$(3)="gelb"
282
+				endif
283
+				if (button_pressed$="lila") then
284
+					DRAW SET "highColor", 155,0,255, "Canvas"
285
+					L_code_array$(3)="lila"
286
+				endif
287
+				DRAW CIRCLE 140,460-abstand_c, 16, "Canvas"
288
+			endif 
289
+			wait 0.2
290
+		endif
291
+			
292
+		switch (casestring$)
293
+			default:
294
+				//print L_code_array$(0)+L_code_array$(1)+L_code_array$(2)+L_code_array$(3)
295
+				if (L_code_array$(0)="" or L_code_array$(1)="" or L_code_array$(2)="" or L_code_array$(3)="") then
296
+					option set "Check","Enabled", 0
297
+					wait 0.2 
298
+				else
299
+					option set "Check","Enabled", 1
300
+					wait 0.2
301
+				endif
302
+			break
303
+		end switch
304
+	wend
305
+end sub
306
+sub WorkDirectory()
307
+REM ######Verzeichnis bestimmen######
308
+
309
+	//if (peek("isbound")) then
310
+	//WorkDir$ = peek$("directory")
311
+	//else
312
+	//WorkDir$ = system$("pwd")
313
+	//WorkDir$ = left$(WorkDir$, len(WorkDir$)-1)
314
+	//fi
315
+	gfx$="/Share/Projekte/yab/mastermind/gfx"
316
+
317
+end sub
318
+
319
+Sub StartWindow()
320
+REM ######Startvariable ######
321
+	alt_runde=0
322
+	dim L_code_array$(4)
323
+	
324
+	ProgrammName$="Find the code"
325
+	Start_FensterName$="FTC"
326
+	NameView$="Untergrund"
327
+	
328
+REM ######Fensteraufbau######
329
+	
330
+	screenWidth = peek("desktopwidth")
331
+	screenHeight = peek("desktopheight")
332
+	WindowSize_x=350
333
+	WindowSize_y=550
334
+	
335
+	window open ((screenWidth/2)-(WindowSize_1/2)), ((screenHeight/2)-(WindowSize_y/2)) to ((screenWidth/2)+(WindowSize_1/2)), ((screenHeight/2)+(WindowSize_y/2)), Start_FensterName$,ProgrammName$
336
+	window set  Start_FensterName$, "MinimumTo", WindowSize_x,WindowSize_y
337
+	window set  Start_FensterName$, "MaximumTo", WindowSize_x,WindowSize_y
338
+	zw_view()
339
+end sub
340
+sub zw_view()	
341
+	if (VIEW GET NameView$ ,"exists") then
342
+		View Remove NameView$
343
+	endif
344
+	View 0,20 to WindowSize_x, WindowSize_y, NameView$, Start_FensterName$
345
+	
346
+	CHECKBOX image WindowSize_x-50,0, "Restart", gfx$+"/refresh_rot.png", gfx$+"/refresh_grau.png", gfx$+"/refresh_grau.png","",false, NameView$
347
+	CHECKBOX image WindowSize_x-50,50, "Check", gfx$+"/check_gelb.png", gfx$+"/check_grau.png", gfx$+"/check_gelb.png","",false, NameView$
348
+		
349
+	option set Start_FensterName$, "focus", true
350
+	
351
+	canvas 40,0 to  WindowSize_x-60, WindowSize_y-70,"Canvas", NameView$
352
+	generiere_canvas()
353
+	erstelle_Code()
354
+	auswahl_farbe()
355
+	
356
+end sub
357
+
358
+sub erstelle_Code()	
359
+REM #### erstelle Code (Computer) ####
360
+REM #### 6 Farben aus denen 4 Farben ausgewählt werden können. ####
361
+REM #### 4 können ausgewählt werden, alle können mehrmals vorkommen. ####	
362
+REM #### Variablen ####
363
+	
364
+	local i
365
+	local x
366
+	
367
+	gruen=0
368
+	braun=0
369
+	lila=0
370
+	rot=0
371
+	blau=0
372
+	gelb=0
373
+	abstand=0
374
+	
375
+REM #### Arrays für den Code erstellen ####
376
+
377
+	dim define_code$(3)
378
+
379
+REM #### Farbarray erstellen, aus dem die Farben per Zufall ausgewählt werden ####
380
+
381
+	dim code_array$(5)
382
+
383
+REM #### Befüllung Farbarray mit den verfügbaren Farben
384
+
385
+	code_array$(0)="gruen"
386
+	code_array$(1)="blau"
387
+	code_array$(2)="rot"
388
+	code_array$(3)="gelb"
389
+	code_array$(4)="lila"
390
+	code_array$(5)="braun"
391
+REM #### Highcolor ändern ####
392
+	
393
+	DRAW SET false, "HighSolidFill"
394
+
395
+REM #### Zufallsgenerator, auswahl Farbarray und Zuweisung zu dem Codearray, sowie malen auf der Canvas  
396
+	
397
+	for i=0 to 3
398
+		x=int(ran(6))
399
+		//print x
400
+		if (code_array$(x)="gruen") then		
401
+			DRAW SET "highColor", 0,255,0, "Canvas"
402
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
403
+			define_code$(i)="gruen"
404
+			gruen=gruen+1
405
+		elseif (code_array$(x)="blau") then
406
+			DRAW SET "highColor", 0,0,255, "Canvas"
407
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
408
+			define_code$(i)="blau"	
409
+			blau=blau+1		
410
+		elseif (code_array$(x)="rot") then
411
+			DRAW SET "highColor", 255,0,0, "Canvas"
412
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
413
+			define_code$(i)="rot"		
414
+			rot=rot+1	
415
+		elseif (code_array$(x)="gelb") then
416
+			DRAW SET "highColor", 255,204,0, "Canvas"
417
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
418
+			define_code$(i)="gelb"
419
+			gelb=gelb+1			
420
+		elseif (code_array$(x)="lila") then
421
+			DRAW SET "highColor", 155,0,255, "Canvas"
422
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
423
+			define_code$(i)="lila"
424
+			lila=lila+1
425
+		elseif (code_array$(x)="braun") then
426
+			DRAW SET "highColor", 100,0,0, "Canvas"
427
+			DRAW CIRCLE 20+abstand,20, 16, "Canvas"
428
+			define_code$(i)="braun"
429
+			braun=braun+1
430
+		endif
431
+		wait 0.1
432
+		abstand=abstand+40
433
+	next i
434
+	
435
+end sub
436
+
437
+sub auswahl_farbe()
438
+REM ### Erstellen der Checkboxen zur Auswahl der Farben vom Spieler
439
+		
440
+	CHECKBOX image WindowSize_x-50,240, "gruen", gfx$+"/gruen_pressed.png", gfx$+"/gruen.png", "","",true, NameView$
441
+	CHECKBOX image WindowSize_x-50,280, "rot", gfx$+"/rot_pressed.png", gfx$+"/rot.png", "", "",false,NameView$
442
+	CHECKBOX image WindowSize_x-50,320, "blau", gfx$+"/blau_pressed.png", gfx$+"/blau.png", "", "",false,NameView$
443
+	CHECKBOX image WindowSize_x-50,360, "gelb", gfx$+"/gelb_pressed.png", gfx$+"/gelb.png", "", "",false,NameView$
444
+	CHECKBOX image WindowSize_x-50,400, "lila", gfx$+"/lila_pressed.png", gfx$+"/lila.png", "", "",false,NameView$
445
+	CHECKBOX image WindowSize_x-50,440, "braun", gfx$+"/braun_pressed.png", gfx$+"/braun.png", "", "",false,NameView$
446
+
447
+end sub
448
+
449
+sub generiere_canvas()
450
+REM #### Erstelle Canvas (Spielfeld) ####
451
+REM #### Variablen erstellen ####
452
+	
453
+	local i,d,a,b,e,p,o
454
+	i=0:d=0:a=0:b=0:e=0:p=0:o=0
455
+	
456
+REM #### Malfarbe anpassen
457
+	
458
+	DRAW SET "highColor", 0,0,0, "Canvas"
459
+	DRAW SET true, "HighSolidFill"
460
+	
461
+REM #### Rechteckmuster erstellen ####
462
+
463
+	for i=1 to 4
464
+		for d=1 to 12
465
+			draw rect 0*i,0*d to 40*i,40*d ,"Canvas"
466
+		next d
467
+	next i
468
+	
469
+REM #### Entfernen der zuviel gemalten Linien ####
470
+REM #### Anpassen der Malfarbe und zurücksetzen der Malfarbe ####
471
+
472
+	DRAW SET "highColor", 255,255,255, "Canvas"
473
+	DRAW SET FALSE, "HighSolidFill"
474
+	DRAW RECT 1,41 TO 159,79, "Canvas"
475
+	DRAW SET "highColor", 0,0,0, "Canvas"
476
+	DRAW SET true, "HighSolidFill"
477
+
478
+REM #### An der Seite die Runde schreiben ####
479
+
480
+	for a=1 to 10
481
+		if (a<10) then
482
+			text$="0"+str$(a)
483
+		else
484
+			text$=str$(a)
485
+		endif
486
+		draw text 5,460-b, "R "+text$, NameView$
487
+		b=b+39.5	 
488
+	next a
489
+
490
+REM #### Rechte Seite die Löcher für die Hinweisstifte malen
491
+
492
+	start_y2=90
493
+	for i = 1 to 4
494
+		for o=1 to 20
495
+			DRAW SET "highColor", 125,125,125, "Canvas"
496
+			DRAW CIRCLE 175+e,start_y2+p, 6, "Canvas"  //male hinweis
497
+			p=p+20
498
+		next o
499
+		p=0
500
+		e=e+20
501
+	next i
502
+
503
+end sub
504
+
505
+sub gewonnen()
506
+	TEXTURL 10,500, "update", "link", "http://www.besly.de/test.php", NameView$
507
+
508
+end sub
509
+
510
+sub runde_markieren(runde)
511
+REM #### Rundenmarkierung auf der linken Seite malen ####
512
+REM #### Startvariablen erstellen, Malfarbe anpassen und zurücksetzen ####
513
+
514
+	local i
515
+	local y
516
+	starty=470
517
+	starty=480
518
+	y=0
519
+	
520
+	DRAW SET "highColor", 5,255,5, NameView$
521
+	DRAW SET false, "HighSolidFill"
522
+	for i=1 to runde		
523
+		draw rect 5,470-y to 35,480-y ,NameView$
524
+		y=y+39
525
+	next i
526
+	DRAW SET "highColor", 0,0,0, NameView$
527
+	
528
+end sub
529
+
530
+sub restart()
531
+	
532
+REM #### alles auf Null zurücksetzen
533
+
534
+	DRAW SET "highColor", 255,255,255, "Canvas"
535
+	DRAW SET FALSE, "HighSolidFill"
536
+	DRAW RECT 0,0 TO 290,480, "Canvas"
537
+	DRAW SET "highcolor", 0,0,0, "Canvas"
538
+	DRAW SET true, "HighSolidFill"
539
+
540
+	DRAW SET FALSE, "HighSolidFill"
541
+	DRAW SET "highColor", 216,216,216, NameView$
542
+	DRAW RECT 0,0 to 40,480,NameView$
543
+	DRAW SET "highColor", 0,0,0, NameView$
544
+	DRAW SET true, "HighSolidFill"
545
+
546
+	L_code_array$(0)=""
547
+	L_code_array$(1)=""
548
+	L_code_array$(2)=""
549
+	L_code_array$(3)=""	
550
+	runde=0
551
+	alt_runde=0
552
+
553
+	//erstelle_Code()
554
+	//generiere_canvas()
555
+	runde_markieren(runde)
556
+zw_view()	
557
+end sub
558
+
559
+sub pruefen()
560
+
561
+	dim stimmt_array(3)	 					
562
+	if (runde=10) then
563
+	 	print "game_over"
564
+	else		
565
+		abstand_c=abstand_c+40
566
+		runde=runde+1
567
+		stimmt=0
568
+		u=0
569
+		c=0
570
+		x=0
571
+		t=0
572
+		e=0
573
+		l_gruen=0
574
+		l_blau=0
575
+		l_rot=0
576
+		l_braun=0
577
+		l_gelb=0
578
+		l_lila=0
579
+		if (runde=1) then
580
+			start_y1=472
581
+			start_y2=450
582
+		else
583
+			start_y1=start_y1-40
584
+			//print start_y1
585
+			start_y2=start_y2-40
586
+			//print start_y2
587
+		endif
588
+			
589
+		for b=0 to 3
590
+			stimmt_array(b)=0
591
+			//print stimmt_array(b)
592
+		next b
593
+	
594
+		
595
+	
596
+		// Ermittlung wieviele Farben und die Anzahl der einzelnen Farben der Code enthält			
597
+		for m=0 to 3
598
+			if(L_code_array$(m)="gruen") then
599
+				l_gruen=l_gruen+1
600
+				print l_gruen
601
+				wait 0.1
602
+			endif
603
+			if(L_code_array$(m)="blau") then
604
+				l_blau=l_blau+1
605
+				print l_blau
606
+				wait 0.1
607
+			endif
608
+			if(L_code_array$(m)="rot") then
609
+				l_rot=l_rot+1
610
+				print l_rot
611
+				wait 0.1
612
+			endif
613
+			if(L_code_array$(m)="gelb") then
614
+				l_gelb=l_gelb+1
615
+				print l_gelb
616
+				wait 0.1
617
+			endif
618
+			if(L_code_array$(m)="braun") then
619
+				l_braun=l_braun+1
620
+				print l_braun
621
+				wait 0.1
622
+			endif
623
+			if(L_code_array$(m)="lila") then
624
+				l_lila=l_lila+1
625
+				print l_lila
626
+				wait 0.1
627
+			endif
628
+		next m	
629
+		nenner_ok=0
630
+		if(gruen >= l_gruen) then
631
+			nenner_ok=nenner_ok+l_gruen
632
+		endif
633
+		if(gruen < l_gruen) then
634
+			nenner_ok=nenner_ok+gruen
635
+		endif
636
+		if(blau >= l_blau) then
637
+			nenner_ok=nenner_ok+l_blau
638
+		endif
639
+		if(blau < l_blau) then
640
+			nenner_ok=nenner_ok+blau
641
+		endif
642
+		if(gelb >= l_gelb) then
643
+			nenner_ok=nenner_ok+l_gelb
644
+		endif
645
+		if(gelb < l_gelb) then
646
+			nenner_ok=nenner_ok+gelb
647
+		endif
648
+		if(lila >= l_lila) then
649
+			nenner_ok=nenner_ok+l_lila
650
+		endif
651
+		if(lila < l_lila) then
652
+			nenner_ok=nenner_ok+lila
653
+		endif
654
+		if(rot >= l_rot) then
655
+			nenner_ok=nenner_ok+l_rot
656
+		endif
657
+		if(rot < l_rot) then
658
+			nenner_ok=nenner_ok+rot
659
+		endif
660
+		if(braun >= l_braun) then
661
+			nenner_ok=nenner_ok+l_braun
662
+		endif
663
+		if(braun < l_braun) then
664
+			nenner_ok=nenner_ok+braun
665
+		endif
666
+		
667
+		//Überprüfung auf Volltreffer
668
+		for u=0 to 3  
669
+			if (L_code_array$(u)=define_code$(u)) then
670
+				if(L_code_array$(u)="gruen") then
671
+					nenner_ok=nenner_ok-1
672
+					stimmt_array(u)=2					
673
+				endif
674
+				
675
+				if(L_code_array$(u)="rot") then
676
+					nenner_ok=nenner_ok-1
677
+					stimmt_array(u)=2
678
+					
679
+				endif
680
+				if(L_code_array$(u)="gelb") then
681
+					nenner_ok=nenner_ok-1
682
+					stimmt_array(u)=2
683
+					
684
+				endif
685
+				if(L_code_array$(u)="blau") then
686
+					nenner_ok=nenner_ok-1
687
+					stimmt_array(u)=2
688
+					
689
+				endif
690
+				if(L_code_array$(u)="braun") then
691
+					nenner_ok=nenner_ok-1
692
+					stimmt_array(u)=2
693
+					
694
+				endif
695
+				if(L_code_array$(u)="lila") then
696
+					nenner_ok=nenner_ok-1
697
+					stimmt_array(u)=2
698
+					
699
+				endif
700
+			else
701
+				stimmt_array(u)=0	
702
+			endif							
703
+		next u
704
+			
705
+		//überprüfung auf Farbe richtig, aber nicht an der richtigen Stelle
706
+		//erste Schleife für den durchlauf welche noch nicht als volltreffer deklariert sind
707
+		
708
+		print "+++++++++++++++"
709
+		print "l_gruen:"+str$(l_gruen)+"|gruen:"+str$(gruen)
710
+		print "l_blau:"+str$(l_blau)+"|blau:"+str$(blau)
711
+		print "l_braun:"+str$(l_braun)+"|braun:"+str$(braun)
712
+		print "l_gelb:"+str$(l_gelb)+"|gelb:"+str$(gelb)
713
+		print "l_rot:"+str$(l_rot)+"|rot:"+str$(rot)
714
+		print "l_lila:"+str$(l_lila)+"|lila:"+str$(lila)
715
+		print "nenner_ok:"+str$(nenner_ok)
716
+		print "+++++++++++++++"
717
+		
718
+		hr=0
719
+		for ho=1 to nenner_ok
720
+			DRAW SET "highColor", 125,125,125, "Canvas"
721
+			DRAW CIRCLE 175+hr,start_y2, 6, "Canvas"  //male hinweis	
722
+			hr=hr+20
723
+		next ho
724
+			
725
+		r=0
726
+		for o=0 to 3
727
+			if(stimmt_array(o)=2) then
728
+				DRAW SET "highColor", 255,125,125, "Canvas"
729
+				DRAW CIRCLE 175+r,start_y1, 6, "Canvas"
730
+			endif
731
+			r=r+20
732
+		next o
733
+		// überprüfung ob alle ein Volltreffer sind.
734
+		for q=0 to 3
735
+			stimmt_array1=stimmt_array1+stimmt_array(q)
736
+			print "stimmt_array :  "+str$(stimmt_array(q))
737
+			if(stimmt_array1=8) then
738
+				gewonnen()
739
+			endif
740
+		next q
741
+		
742
+	endif
743
+	runde_markieren(runde)
744
+end sub
745
+
746
+sub erstelle_Button()
747
+REM #### Erstelle Button beim Starten und speichere Diese im Verzeichnis
748
+
749
+	ID_Button$="Buttons"
750
+	Bitmap 41,41, ID_Button$
751
+	
752
+	DRAW SET "highColor", 0,255,0, ID_Button$
753
+	DRAW CIRCLE 20,20, 16, ID_Button$
754
+	BITMAP GET 0,0 to 40,40, "save1", ID_Button$
755
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gruen.png", "png"	
756
+				
757
+	DRAW SET "highColor", 0,0,255, ID_Button$
758
+	DRAW CIRCLE 20,20, 16, ID_Button$
759
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
760
+	ErrCode = BITMAP SAVE "save1", gfx$+"/blau.png", "png"		
761
+		
762
+	DRAW SET "highColor", 255,0,0, ID_Button$
763
+	DRAW CIRCLE 20,20, 16, ID_Button$
764
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
765
+	ErrCode = BITMAP SAVE "save1", gfx$+"/rot.png", "png"			
766
+		
767
+	DRAW SET "highColor", 255,204,0, ID_Button$
768
+	DRAW CIRCLE 20,20, 16, ID_Button$
769
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
770
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gelb.png", "png"
771
+		
772
+	DRAW SET "highColor", 155,0,255,ID_Button$
773
+	DRAW CIRCLE 20,20, 16, ID_Button$
774
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
775
+	ErrCode = BITMAP SAVE "save1", gfx$+"/lila.png", "png"
776
+		
777
+	DRAW SET "highColor", 100,0,0, ID_Button$
778
+	DRAW CIRCLE 20,20, 16, ID_Button$
779
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
780
+	ErrCode = BITMAP SAVE "save1", gfx$+"/braun.png", "png"	
781
+	
782
+	
783
+	// gedrückte Buttons
784
+	DRAW SET "highColor", 0,255,0, ID_Button$
785
+	DRAW CIRCLE 20,20, 16, ID_Button$
786
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
787
+	DRAW SET 0, "HighSolidFill"	
788
+	draw rect 0,35 to 40,40 ,ID_Button$
789
+	BITMAP GET 0,0 to 40,40, "save1", ID_Button$
790
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gruen_pressed.png", "png"	
791
+					
792
+	DRAW SET "highColor", 0,0,255, ID_Button$
793
+	DRAW CIRCLE 20,20, 16, ID_Button$
794
+	DRAW SET 0, "HighSolidFill"
795
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
796
+	draw rect 0,35 to 40,40 ,ID_Button$
797
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
798
+	ErrCode = BITMAP SAVE "save1", gfx$+"/blau_pressed.png", "png"		
799
+		
800
+	DRAW SET "highColor", 255,0,0, ID_Button$
801
+	DRAW CIRCLE 20,20, 16, ID_Button$
802
+	DRAW SET 0, "HighSolidFill"
803
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
804
+	draw rect 0,35 to 40,40 ,ID_Button$
805
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
806
+	ErrCode = BITMAP SAVE "save1", gfx$+"/rot_pressed.png", "png"			
807
+		
808
+	DRAW SET "highColor", 255,204,0, ID_Button$
809
+	DRAW CIRCLE 20,20, 16, ID_Button$
810
+	DRAW SET 0, "HighSolidFill"
811
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
812
+	draw rect 0,35 to 40,40 ,ID_Button$
813
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
814
+	ErrCode = BITMAP SAVE "save1", gfx$+"/gelb_pressed.png", "png"
815
+		
816
+	DRAW SET "highColor", 155,0,255,ID_Button$
817
+	DRAW CIRCLE 20,20, 16, ID_Button$
818
+	DRAW SET 0, "HighSolidFill"
819
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
820
+	draw rect 0,35 to 40,40 ,ID_Button$
821
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
822
+	ErrCode = BITMAP SAVE "save1", gfx$+"/lila_pressed.png", "png"
823
+		
824
+	DRAW SET "highColor", 100,0,0, ID_Button$
825
+	DRAW CIRCLE 20,20, 16, ID_Button$
826
+	DRAW SET 0, "HighSolidFill"
827
+	DRAW SET "highColor", 0, 0, 0, ID_Button$ 
828
+	draw rect 0,35 to 40,40 ,ID_Button$
829
+	BITMAP GET 0,0 to 40,40, "save1",ID_Button$
830
+	ErrCode = BITMAP SAVE "save1", gfx$+"/braun_pressed.png", "png"	
831
+		
832
+end sub
0 833
new file mode 100755
... ...
@@ -0,0 +1,863 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+WorkDirectory()
4
+erstelle_Button()
5
+StartWindow()
6
+
7
+main()
8
+
9
+sub main()
10
+		
11
+	dim part$(1)
12
+	dim mesg$(1)
13
+	dim mouse$(1)
14
+	dim ViewMouse$(1)
15
+	inloop = true
16
+	while(inloop)
17
+		//Tastaturabfragen
18
+			keymsg$ = keyboard message$(Start_FensterName$) //
19
+		if(keymsg$<>"" and keymsg$<>old_keymsg$) then
20
+			//print keymsg$
21
+			old_keymsg$ = keymsg$
22
+		endif
23
+	
24
+		switch(keymsg$)
25
+		
26
+			default:
27
+			break
28
+		
29
+		end switch
30
+	
31
+		msg$ = message$
32
+		numSplit = split(msg$,mesg$(),"|")
33
+		for countMessages = 1 to numSplit
34
+			msg$ = mesg$(countMessages) + "|"
35
+			if (split(msg$, part$(), ":|") > 3) then
36
+				PartOne$=part$(1)
37
+				PartTwo$ = part$(2)
38
+				PartThree$ = part$(3)
39
+				PartFour$= part$(4)				
40
+			endif
41
+			if (msg$ <> "") print msg$
42
+			
43
+			switch (msg$)
44
+				case Start_FensterName$+":_QuitRequested|"
45
+					window close Start_FensterName$
46
+					break
47
+				case Start_FensterName$+":Programm:Quit|"
48
+				case Start_FensterName$+":Programm:Beenden|"
49
+					window close Start_FensterName$
50
+					break					
51
+				case "Restart|"
52
+					restart()
53
+				break		
54
+				case "Check|"
55
+					pruefen()
56
+				break
57
+				case "braun:ON|"
58
+					button_pressed$="braun"
59
+					CHECKBOX SET "blau", false						
60
+					CHECKBOX SET "gruen", false					
61
+					CHECKBOX SET "gelb", false						
62
+					CHECKBOX SET "rot",  false	
63
+					CHECKBOX SET "lila",  false				
64
+				break
65
+				case "braun:OFF|"	
66
+				break
67
+				case "rot:ON|"
68
+					button_pressed$="rot"
69
+					CHECKBOX SET "blau", false						
70
+					CHECKBOX SET "gruen", false					
71
+					CHECKBOX SET "gelb", false						
72
+					CHECKBOX SET "braun",  false	
73
+					CHECKBOX SET "lila",  false						
74
+				break
75
+				case "rot:OFF|"	
76
+				break
77
+				case "blau:ON|"
78
+					button_pressed$="blau"
79
+					CHECKBOX SET "braun", false						
80
+					CHECKBOX SET "gruen", false					
81
+					CHECKBOX SET "gelb", false						
82
+					CHECKBOX SET "rot",  false	
83
+					CHECKBOX SET "lila",  false				
84
+				break
85
+				case "blau:OFF|"	
86
+				break
87
+				case "lila:ON|"
88
+					button_pressed$="lila"
89
+					CHECKBOX SET "blau", false						
90
+					CHECKBOX SET "gruen", false					
91
+					CHECKBOX SET "gelb", false						
92
+					CHECKBOX SET "rot",  false	
93
+					CHECKBOX SET "braun",  false				
94
+					
95
+				break
96
+				case "lila:OFF|"	
97
+				break
98
+				case "gelb:ON|"
99
+					button_pressed$="gelb"
100
+					CHECKBOX SET "blau", false						
101
+					CHECKBOX SET "gruen", false					
102
+					CHECKBOX SET "braun", false						
103
+					CHECKBOX SET "rot",  false	
104
+					CHECKBOX SET "lila",  false				
105
+				break
106
+				case "gelb:OFF|"	
107
+				break
108
+				case "gruen:ON|"
109
+					button_pressed$="gruen"
110
+					CHECKBOX SET "blau", false						
111
+					CHECKBOX SET "gelb", false					
112
+					CHECKBOX SET "braun", false						
113
+					CHECKBOX SET "rot",  false	
114
+					CHECKBOX SET "lila",  false				
115
+				break
116
+				case "gruen:OFF|"	
117
+				break
118
+				case "Check:ON|"				
119
+					pruefen()
120
+					CHECKBOX SET "blau", false						
121
+					CHECKBOX SET "gruen", true					
122
+					CHECKBOX SET "braun", false						
123
+					CHECKBOX SET "rot",  false	
124
+					CHECKBOX SET "lila",  false	
125
+					CHECKBOX SET "gelb",  false				
126
+					CHECKBOX SET "Check", false
127
+					button_pressed$="gruen"
128
+					L_code_array$(0)=""
129
+					L_code_array$(1)=""
130
+					L_code_array$(2)=""
131
+					L_code_array$(3)=""						
132
+					alte_runde=runde
133
+				break
134
+				case "Restart:ON|"
135
+					abstand_c=0
136
+					restart()
137
+					CHECKBOX SET "blau", false						
138
+					CHECKBOX SET "gruen", true									
139
+					CHECKBOX SET "braun", false						
140
+					CHECKBOX SET "rot",  false	
141
+					CHECKBOX SET "lila",  false	
142
+					CHECKBOX SET "gelb",  false	
143
+					button_pressed$="gruen"	
144
+				break
145
+				default:
146
+					
147
+				break
148
+			end switch
149
+		
150
+			if(window count<1) inloop = false
151
+			sleep 0.001
152
+		next countMessages
153
+		
154
+		//Mausabfragen
155
+		mmsg$ = MOUSE MESSAGE$
156
+		if (mmsg$<>"" and mmsg$<>old_mmsg$) then
157
+			//print mmsg$
158
+			old_mmsg$= mmsg$ 
159
+			n1 = split(mmsg$, mouse$(), ":")
160
+			Viewname$=mouse$(1)
161
+			
162
+			Xmouse	= val(mouse$(2))
163
+			Ymouse	= val(mouse$(3))
164
+			BLmouse	= val(mouse$(4))
165
+			BCmouse= val(mouse$(5))
166
+			BRmouse= val(mouse$(6))
167
+			casestring$=Viewname$+":"+mouse$(2)+":"+mouse$(3)+":"+mouse$(6)
168
+			mmsg$=""
169
+			print casestring$
170
+		endif
171
+		if (Xmouse>=0 and Ymouse<480-abstand_c and Xmouse<40 and Ymouse>440-abstand_c) then
172
+			if (BLmouse=1) then
173
+				if (button_pressed$="braun") then					
174
+					DRAW SET "highColor", 100,0,0, "Canvas"
175
+					L_code_array$(0)="braun"
176
+				endif
177
+				if (button_pressed$="gruen") then		
178
+					DRAW SET "highColor", 0,255,0, "Canvas"
179
+					L_code_array$(0)="gruen"
180
+				endif
181
+				if (button_pressed$="blau") then
182
+					DRAW SET "highColor", 0,0,255, "Canvas"
183
+					L_code_array$(0)="blau"
184
+				endif
185
+				if (button_pressed$="rot") then
186
+					DRAW SET "highColor", 255,0,0, "Canvas"
187
+					L_code_array$(0)="rot"
188
+				endif
189
+				if (button_pressed$="gelb") then	
190
+					DRAW SET "highColor", 255,204,0, "Canvas"
191
+					L_code_array$(0)="gelb"
192
+				endif
193
+				if (button_pressed$="lila") then
194
+					DRAW SET "highColor", 155,0,255, "Canvas"
195
+					L_code_array$(0)="lila"
196
+				endif
197
+				DRAW CIRCLE 20,460-abstand_c, 16, "Canvas"
198
+			endif 
199
+			wait 0.01
200
+		endif
201
+		if (Xmouse>=41 and Ymouse<480-abstand_c and Xmouse<=79 and Ymouse>440-abstand_c) then
202
+			if (BLmouse=1) then
203
+				if (button_pressed$="braun") then					
204
+					DRAW SET "highColor", 100,0,0, "Canvas"
205
+					L_code_array$(1)="braun"
206
+				endif