Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/logo-code/maquina_4_estados_2_motores.txt
blob: 746fab028f0ba1471b3e1bf3236aaff8bfc830b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
global x
to start
	setx 0
	abcd,off	
	a, thisway
	d, thatway
	loop
	[
		ifelse (sensor8<512)
		[
			if (x=0)
			[
				setx 1
				d,off
				a,on
				a,thisway
				beep
			]
			if (x=2)
			[
				setx 3
				a,thatway				
				beep
			]
			if (x=4)
			[
				setx 5
				a,off
				d,on
				d,thatway
				beep
			]
			if (x=6)
			[
				setx 7
				d,thisway
				beep
			]
		]		
		[
			if (x=1)[setx 2]
			if (x=3)[setx 4]
			if (x=5)[setx 6]
			if (x=7)[setx 0]
		]

	]
end