smalruby-editor 0.2.2-x86-mingw32 → 0.2.3-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of smalruby-editor might be problematic. Click here for more details.

Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/Guardfile +2 -6
  4. data/LEGAL +6 -0
  5. data/README.rdoc +2 -0
  6. data/app/assets/javascripts/application.js +1 -0
  7. data/app/assets/javascripts/blocks/hardware.js.coffee.erb +37 -0
  8. data/app/assets/javascripts/models/source_code.js +123 -0
  9. data/app/assets/javascripts/msg/en_us.js +2 -0
  10. data/app/assets/javascripts/msg/ja.js +2 -0
  11. data/app/assets/javascripts/smalruby.js.coffee.erb +1 -1
  12. data/app/assets/javascripts/views/character_modal_view.js.coffee +2 -0
  13. data/app/assets/javascripts/views/character_selector_view.js.coffee +2 -2
  14. data/app/assets/javascripts/views/load_modal_view.js.coffee.erb +2 -0
  15. data/app/assets/javascripts/views/reset_modal_view.js.coffee +2 -0
  16. data/app/assets/stylesheets/application.css +0 -0
  17. data/app/assets/stylesheets/editor.css.scss +0 -0
  18. data/app/assets/stylesheets/toolbox_raspberrypi.css.scss.erb +32 -0
  19. data/app/assets/stylesheets/toolbox_smalrubot_s1.css.scss.erb +1 -0
  20. data/app/controllers/editor_controller.rb +0 -0
  21. data/app/helpers/application_helper.rb +5 -0
  22. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_dc_motor_power_ratio.rb +26 -0
  23. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_dc_motor_set_power_ratio.rb +21 -0
  24. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_motor_set_speed.rb +21 -0
  25. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_motor_speed.rb +26 -0
  26. data/app/models/source_code.rb +0 -0
  27. data/app/views/editor/_toolbox_default.html.haml +7 -3
  28. data/app/views/editor/_toolbox_raspberrypi.html.haml +233 -0
  29. data/app/views/editor/_toolbox_smalrubot_s1.html.haml +75 -51
  30. data/app/views/editor/_toolbox_smalrubot_v3.html.haml +70 -55
  31. data/app/views/editor/index.html.haml +0 -6
  32. data/app/views/layouts/application.html.erb +1 -0
  33. data/db/schema.rb +23 -23
  34. data/lib/smalruby_editor.rb +5 -1
  35. data/lib/smalruby_editor/config.rb +2 -0
  36. data/lib/smalruby_editor/version.rb +1 -1
  37. data/smalruby-editor.gemspec +1 -1
  38. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_dc_motor_power_ratio.feature +116 -0
  39. data/spec/javascripts/models/source_code_spec.coffee +5 -0
  40. data/spec/models/concerns/ruby_to_block/block/hardware__smalrubot_s1_spec.rb +89 -1
  41. data/spec/models/concerns/ruby_to_block/block/hardware__smalrubot_v3_spec.rb +433 -0
  42. data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +0 -338
  43. data/vendor/assets/javascripts/strftime-min.js +8 -0
  44. metadata +27 -14
  45. data/app/assets/javascripts/models/source_code.js.coffee +0 -80
@@ -0,0 +1,433 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+ require_relative 'shared/block_examples'
4
+
5
+ # rubocop:disable EmptyLines, LineLength
6
+
7
+ describe RubyToBlock::Block, 'Smalrubot v3 blocks', to_blocks: true do
8
+ parts = <<-EOS
9
+ require "smalruby"
10
+
11
+ init_hardware
12
+ car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
13
+
14
+ car1.on(:start) do
15
+ smalrubot_v3.forward
16
+ smalrubot_v3.backward
17
+ smalrubot_v3.turn_left
18
+ smalrubot_v3.turn_right
19
+ smalrubot_v3.stop
20
+
21
+ smalrubot_v3.forward(sec: 0.5)
22
+ smalrubot_v3.backward(sec: 0.4)
23
+ smalrubot_v3.turn_left(sec: 0.3)
24
+ smalrubot_v3.turn_right(sec: 0.2)
25
+ smalrubot_v3.stop(sec: 0.1)
26
+
27
+ p(smalrubot_v3.left_touch_sensor.pressed?)
28
+ p(smalrubot_v3.left_touch_sensor.released?)
29
+ p(smalrubot_v3.right_touch_sensor.pressed?)
30
+ p(smalrubot_v3.right_touch_sensor.released?)
31
+
32
+ p(smalrubot_v3.light_sensor.value)
33
+
34
+ smalrubot_v3.red_led.turn_on
35
+ smalrubot_v3.green_led.turn_off
36
+
37
+ p(smalrubot_v3.left_motor_speed)
38
+ p(smalrubot_v3.right_motor_speed)
39
+
40
+ smalrubot_v3.left_motor_speed = 10
41
+ smalrubot_v3.right_motor_speed = 90
42
+ end
43
+ car1.smalrubot_v3.forward
44
+ car1.smalrubot_v3.backward
45
+ car1.smalrubot_v3.turn_left
46
+ car1.smalrubot_v3.turn_right
47
+ car1.smalrubot_v3.stop
48
+
49
+ car1.smalrubot_v3.forward(sec: 0.5)
50
+ car1.smalrubot_v3.backward(sec: 0.4)
51
+ car1.smalrubot_v3.turn_left(sec: 0.3)
52
+ car1.smalrubot_v3.turn_right(sec: 0.2)
53
+ car1.smalrubot_v3.stop(sec: 0.1)
54
+
55
+ p(car1.smalrubot_v3.left_touch_sensor.pressed?)
56
+ p(car1.smalrubot_v3.left_touch_sensor.released?)
57
+ p(car1.smalrubot_v3.right_touch_sensor.pressed?)
58
+ p(car1.smalrubot_v3.right_touch_sensor.released?)
59
+
60
+ p(car1.smalrubot_v3.light_sensor.value)
61
+
62
+ car1.smalrubot_v3.red_led.turn_on
63
+ car1.smalrubot_v3.green_led.turn_off
64
+
65
+ p(car1.smalrubot_v3.left_motor_speed)
66
+ p(car1.smalrubot_v3.right_motor_speed)
67
+
68
+ car1.smalrubot_v3.left_motor_speed = 10
69
+ car1.smalrubot_v3.right_motor_speed = 90
70
+ EOS
71
+ describe compact_source_code(parts) do
72
+ _parts = parts
73
+ let(:data) { _parts }
74
+
75
+ it '結果が正しいこと' do
76
+ should eq_block_xml(<<-XML)
77
+ <character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
78
+ <block type="hardware_init_hardware" />
79
+ <block type="character_new">
80
+ <field name="NAME">car1</field>
81
+ <statement name="DO">
82
+ <block type="events_on_start">
83
+ <statement name="DO">
84
+ <block type="hardware_smalrubot_v3_action" inline="true">
85
+ <field name="ACTION">forward</field>
86
+ <next>
87
+ <block type="hardware_smalrubot_v3_action" inline="true">
88
+ <field name="ACTION">backward</field>
89
+ <next>
90
+ <block type="hardware_smalrubot_v3_action" inline="true">
91
+ <field name="ACTION">turn_left</field>
92
+ <next>
93
+ <block type="hardware_smalrubot_v3_action" inline="true">
94
+ <field name="ACTION">turn_right</field>
95
+ <next>
96
+ <block type="hardware_smalrubot_v3_action" inline="true">
97
+ <field name="ACTION">stop</field>
98
+ <next>
99
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
100
+ <field name="ACTION">forward</field>
101
+ <value name="SEC">
102
+ <block type="math_number">
103
+ <field name="NUM">0.5</field>
104
+ </block>
105
+ </value>
106
+ <next>
107
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
108
+ <field name="ACTION">backward</field>
109
+ <value name="SEC">
110
+ <block type="math_number">
111
+ <field name="NUM">0.4</field>
112
+ </block>
113
+ </value>
114
+ <next>
115
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
116
+ <field name="ACTION">turn_left</field>
117
+ <value name="SEC">
118
+ <block type="math_number">
119
+ <field name="NUM">0.3</field>
120
+ </block>
121
+ </value>
122
+ <next>
123
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
124
+ <field name="ACTION">turn_right</field>
125
+ <value name="SEC">
126
+ <block type="math_number">
127
+ <field name="NUM">0.2</field>
128
+ </block>
129
+ </value>
130
+ <next>
131
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
132
+ <field name="ACTION">stop</field>
133
+ <value name="SEC">
134
+ <block type="math_number">
135
+ <field name="NUM">0.1</field>
136
+ </block>
137
+ </value>
138
+ <next>
139
+ <block type="ruby_p" inline="true">
140
+ <value name="ARG">
141
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
142
+ <field name="LOR">left</field>
143
+ <field name="POR">pressed</field>
144
+ </block>
145
+ </value>
146
+ <next>
147
+ <block type="ruby_p" inline="true">
148
+ <value name="ARG">
149
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
150
+ <field name="LOR">left</field>
151
+ <field name="POR">released</field>
152
+ </block>
153
+ </value>
154
+ <next>
155
+ <block type="ruby_p" inline="true">
156
+ <value name="ARG">
157
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
158
+ <field name="LOR">right</field>
159
+ <field name="POR">pressed</field>
160
+ </block>
161
+ </value>
162
+ <next>
163
+ <block type="ruby_p" inline="true">
164
+ <value name="ARG">
165
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
166
+ <field name="LOR">right</field>
167
+ <field name="POR">released</field>
168
+ </block>
169
+ </value>
170
+ <next>
171
+ <block type="ruby_p" inline="true">
172
+ <value name="ARG">
173
+ <block type="hardware_smalrubot_v3_light_sensor_value" />
174
+ </value>
175
+ <next>
176
+ <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
177
+ <field name="COLOUR">red</field>
178
+ <field name="OOO">turn_on</field>
179
+ <next>
180
+ <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
181
+ <field name="COLOUR">green</field>
182
+ <field name="OOO">turn_off</field>
183
+ <next>
184
+ <block type="ruby_p" inline="true">
185
+ <value name="ARG">
186
+ <block type="hardware_smalrubot_v3_motor_speed">
187
+ <field name="LOR">left</field>
188
+ </block>
189
+ </value>
190
+ <next>
191
+ <block type="ruby_p" inline="true">
192
+ <value name="ARG">
193
+ <block type="hardware_smalrubot_v3_motor_speed">
194
+ <field name="LOR">right</field>
195
+ </block>
196
+ </value>
197
+ <next>
198
+ <block type="hardware_smalrubot_v3_motor_set_speed" inline="true">
199
+ <field name="LOR">left</field>
200
+ <value name="SPEED">
201
+ <block type="math_number">
202
+ <field name="NUM">10</field>
203
+ </block>
204
+ </value>
205
+ <next>
206
+ <block type="hardware_smalrubot_v3_motor_set_speed" inline="true">
207
+ <field name="LOR">right</field>
208
+ <value name="SPEED">
209
+ <block type="math_number">
210
+ <field name="NUM">90</field>
211
+ </block>
212
+ </value>
213
+ </block>
214
+ </next>
215
+ </block>
216
+ </next>
217
+ </block>
218
+ </next>
219
+ </block>
220
+ </next>
221
+ </block>
222
+ </next>
223
+ </block>
224
+ </next>
225
+ </block>
226
+ </next>
227
+ </block>
228
+ </next>
229
+ </block>
230
+ </next>
231
+ </block>
232
+ </next>
233
+ </block>
234
+ </next>
235
+ </block>
236
+ </next>
237
+ </block>
238
+ </next>
239
+ </block>
240
+ </next>
241
+ </block>
242
+ </next>
243
+ </block>
244
+ </next>
245
+ </block>
246
+ </next>
247
+ </block>
248
+ </next>
249
+ </block>
250
+ </next>
251
+ </block>
252
+ </next>
253
+ </block>
254
+ </statement>
255
+ <next>
256
+ <block type="hardware_smalrubot_v3_action" inline="true">
257
+ <field name="ACTION">forward</field>
258
+ <next>
259
+ <block type="hardware_smalrubot_v3_action" inline="true">
260
+ <field name="ACTION">backward</field>
261
+ <next>
262
+ <block type="hardware_smalrubot_v3_action" inline="true">
263
+ <field name="ACTION">turn_left</field>
264
+ <next>
265
+ <block type="hardware_smalrubot_v3_action" inline="true">
266
+ <field name="ACTION">turn_right</field>
267
+ <next>
268
+ <block type="hardware_smalrubot_v3_action" inline="true">
269
+ <field name="ACTION">stop</field>
270
+ <next>
271
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
272
+ <field name="ACTION">forward</field>
273
+ <value name="SEC">
274
+ <block type="math_number">
275
+ <field name="NUM">0.5</field>
276
+ </block>
277
+ </value>
278
+ <next>
279
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
280
+ <field name="ACTION">backward</field>
281
+ <value name="SEC">
282
+ <block type="math_number">
283
+ <field name="NUM">0.4</field>
284
+ </block>
285
+ </value>
286
+ <next>
287
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
288
+ <field name="ACTION">turn_left</field>
289
+ <value name="SEC">
290
+ <block type="math_number">
291
+ <field name="NUM">0.3</field>
292
+ </block>
293
+ </value>
294
+ <next>
295
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
296
+ <field name="ACTION">turn_right</field>
297
+ <value name="SEC">
298
+ <block type="math_number">
299
+ <field name="NUM">0.2</field>
300
+ </block>
301
+ </value>
302
+ <next>
303
+ <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
304
+ <field name="ACTION">stop</field>
305
+ <value name="SEC">
306
+ <block type="math_number">
307
+ <field name="NUM">0.1</field>
308
+ </block>
309
+ </value>
310
+ <next>
311
+ <block type="ruby_p" inline="true">
312
+ <value name="ARG">
313
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
314
+ <field name="LOR">left</field>
315
+ <field name="POR">pressed</field>
316
+ </block>
317
+ </value>
318
+ <next>
319
+ <block type="ruby_p" inline="true">
320
+ <value name="ARG">
321
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
322
+ <field name="LOR">left</field>
323
+ <field name="POR">released</field>
324
+ </block>
325
+ </value>
326
+ <next>
327
+ <block type="ruby_p" inline="true">
328
+ <value name="ARG">
329
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
330
+ <field name="LOR">right</field>
331
+ <field name="POR">pressed</field>
332
+ </block>
333
+ </value>
334
+ <next>
335
+ <block type="ruby_p" inline="true">
336
+ <value name="ARG">
337
+ <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
338
+ <field name="LOR">right</field>
339
+ <field name="POR">released</field>
340
+ </block>
341
+ </value>
342
+ <next>
343
+ <block type="ruby_p" inline="true">
344
+ <value name="ARG">
345
+ <block type="hardware_smalrubot_v3_light_sensor_value" />
346
+ </value>
347
+ <next>
348
+ <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
349
+ <field name="COLOUR">red</field>
350
+ <field name="OOO">turn_on</field>
351
+ <next>
352
+ <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
353
+ <field name="COLOUR">green</field>
354
+ <field name="OOO">turn_off</field>
355
+ <next>
356
+ <block type="ruby_p" inline="true">
357
+ <value name="ARG">
358
+ <block type="hardware_smalrubot_v3_motor_speed">
359
+ <field name="LOR">left</field>
360
+ </block>
361
+ </value>
362
+ <next>
363
+ <block type="ruby_p" inline="true">
364
+ <value name="ARG">
365
+ <block type="hardware_smalrubot_v3_motor_speed">
366
+ <field name="LOR">right</field>
367
+ </block>
368
+ </value>
369
+ <next>
370
+ <block type="hardware_smalrubot_v3_motor_set_speed" inline="true">
371
+ <field name="LOR">left</field>
372
+ <value name="SPEED">
373
+ <block type="math_number">
374
+ <field name="NUM">10</field>
375
+ </block>
376
+ </value>
377
+ <next>
378
+ <block type="hardware_smalrubot_v3_motor_set_speed" inline="true">
379
+ <field name="LOR">right</field>
380
+ <value name="SPEED">
381
+ <block type="math_number">
382
+ <field name="NUM">90</field>
383
+ </block>
384
+ </value>
385
+ </block>
386
+ </next>
387
+ </block>
388
+ </next>
389
+ </block>
390
+ </next>
391
+ </block>
392
+ </next>
393
+ </block>
394
+ </next>
395
+ </block>
396
+ </next>
397
+ </block>
398
+ </next>
399
+ </block>
400
+ </next>
401
+ </block>
402
+ </next>
403
+ </block>
404
+ </next>
405
+ </block>
406
+ </next>
407
+ </block>
408
+ </next>
409
+ </block>
410
+ </next>
411
+ </block>
412
+ </next>
413
+ </block>
414
+ </next>
415
+ </block>
416
+ </next>
417
+ </block>
418
+ </next>
419
+ </block>
420
+ </next>
421
+ </block>
422
+ </next>
423
+ </block>
424
+ </next>
425
+ </block>
426
+ </next>
427
+ </block>
428
+ </statement>
429
+ </block>
430
+ XML
431
+ end
432
+ end
433
+ end
@@ -451,342 +451,4 @@ p(car1.button("D3").pressed?)
451
451
  XML
452
452
  end
453
453
  end
454
-
455
- parts = <<-EOS
456
- require "smalruby"
457
-
458
- init_hardware
459
- car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
460
-
461
- car1.on(:start) do
462
- smalrubot_v3.forward
463
- smalrubot_v3.backward
464
- smalrubot_v3.turn_left
465
- smalrubot_v3.turn_right
466
- smalrubot_v3.stop
467
-
468
- smalrubot_v3.forward(sec: 0.5)
469
- smalrubot_v3.backward(sec: 0.4)
470
- smalrubot_v3.turn_left(sec: 0.3)
471
- smalrubot_v3.turn_right(sec: 0.2)
472
- smalrubot_v3.stop(sec: 0.1)
473
-
474
- p(smalrubot_v3.left_touch_sensor.pressed?)
475
- p(smalrubot_v3.left_touch_sensor.released?)
476
- p(smalrubot_v3.right_touch_sensor.pressed?)
477
- p(smalrubot_v3.right_touch_sensor.released?)
478
-
479
- p(smalrubot_v3.light_sensor.value)
480
-
481
- smalrubot_v3.red_led.turn_on
482
- smalrubot_v3.green_led.turn_off
483
- end
484
- car1.smalrubot_v3.forward
485
- car1.smalrubot_v3.backward
486
- car1.smalrubot_v3.turn_left
487
- car1.smalrubot_v3.turn_right
488
- car1.smalrubot_v3.stop
489
-
490
- car1.smalrubot_v3.forward(sec: 0.5)
491
- car1.smalrubot_v3.backward(sec: 0.4)
492
- car1.smalrubot_v3.turn_left(sec: 0.3)
493
- car1.smalrubot_v3.turn_right(sec: 0.2)
494
- car1.smalrubot_v3.stop(sec: 0.1)
495
-
496
- p(car1.smalrubot_v3.left_touch_sensor.pressed?)
497
- p(car1.smalrubot_v3.left_touch_sensor.released?)
498
- p(car1.smalrubot_v3.right_touch_sensor.pressed?)
499
- p(car1.smalrubot_v3.right_touch_sensor.released?)
500
-
501
- p(car1.smalrubot_v3.light_sensor.value)
502
-
503
- car1.smalrubot_v3.red_led.turn_on
504
- car1.smalrubot_v3.green_led.turn_off
505
- EOS
506
- describe compact_source_code(parts) do
507
- _parts = parts
508
- let(:data) { _parts }
509
-
510
- it '結果が正しいこと' do
511
- should eq_block_xml(<<-XML)
512
- <character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
513
- <block type="hardware_init_hardware" />
514
- <block type="character_new">
515
- <field name="NAME">car1</field>
516
- <statement name="DO">
517
- <block type="events_on_start">
518
- <statement name="DO">
519
- <block type="hardware_smalrubot_v3_action" inline="true">
520
- <field name="ACTION">forward</field>
521
- <next>
522
- <block type="hardware_smalrubot_v3_action" inline="true">
523
- <field name="ACTION">backward</field>
524
- <next>
525
- <block type="hardware_smalrubot_v3_action" inline="true">
526
- <field name="ACTION">turn_left</field>
527
- <next>
528
- <block type="hardware_smalrubot_v3_action" inline="true">
529
- <field name="ACTION">turn_right</field>
530
- <next>
531
- <block type="hardware_smalrubot_v3_action" inline="true">
532
- <field name="ACTION">stop</field>
533
- <next>
534
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
535
- <field name="ACTION">forward</field>
536
- <value name="SEC">
537
- <block type="math_number">
538
- <field name="NUM">0.5</field>
539
- </block>
540
- </value>
541
- <next>
542
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
543
- <field name="ACTION">backward</field>
544
- <value name="SEC">
545
- <block type="math_number">
546
- <field name="NUM">0.4</field>
547
- </block>
548
- </value>
549
- <next>
550
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
551
- <field name="ACTION">turn_left</field>
552
- <value name="SEC">
553
- <block type="math_number">
554
- <field name="NUM">0.3</field>
555
- </block>
556
- </value>
557
- <next>
558
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
559
- <field name="ACTION">turn_right</field>
560
- <value name="SEC">
561
- <block type="math_number">
562
- <field name="NUM">0.2</field>
563
- </block>
564
- </value>
565
- <next>
566
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
567
- <field name="ACTION">stop</field>
568
- <value name="SEC">
569
- <block type="math_number">
570
- <field name="NUM">0.1</field>
571
- </block>
572
- </value>
573
- <next>
574
- <block type="ruby_p" inline="true">
575
- <value name="ARG">
576
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
577
- <field name="LOR">left</field>
578
- <field name="POR">pressed</field>
579
- </block>
580
- </value>
581
- <next>
582
- <block type="ruby_p" inline="true">
583
- <value name="ARG">
584
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
585
- <field name="LOR">left</field>
586
- <field name="POR">released</field>
587
- </block>
588
- </value>
589
- <next>
590
- <block type="ruby_p" inline="true">
591
- <value name="ARG">
592
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
593
- <field name="LOR">right</field>
594
- <field name="POR">pressed</field>
595
- </block>
596
- </value>
597
- <next>
598
- <block type="ruby_p" inline="true">
599
- <value name="ARG">
600
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
601
- <field name="LOR">right</field>
602
- <field name="POR">released</field>
603
- </block>
604
- </value>
605
- <next>
606
- <block type="ruby_p" inline="true">
607
- <value name="ARG">
608
- <block type="hardware_smalrubot_v3_light_sensor_value" />
609
- </value>
610
- <next>
611
- <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
612
- <field name="COLOUR">red</field>
613
- <field name="OOO">turn_on</field>
614
- <next>
615
- <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
616
- <field name="COLOUR">green</field>
617
- <field name="OOO">turn_off</field>
618
- </block>
619
- </next>
620
- </block>
621
- </next>
622
- </block>
623
- </next>
624
- </block>
625
- </next>
626
- </block>
627
- </next>
628
- </block>
629
- </next>
630
- </block>
631
- </next>
632
- </block>
633
- </next>
634
- </block>
635
- </next>
636
- </block>
637
- </next>
638
- </block>
639
- </next>
640
- </block>
641
- </next>
642
- </block>
643
- </next>
644
- </block>
645
- </next>
646
- </block>
647
- </next>
648
- </block>
649
- </next>
650
- </block>
651
- </statement>
652
- <next>
653
- <block type="hardware_smalrubot_v3_action" inline="true">
654
- <field name="ACTION">forward</field>
655
- <next>
656
- <block type="hardware_smalrubot_v3_action" inline="true">
657
- <field name="ACTION">backward</field>
658
- <next>
659
- <block type="hardware_smalrubot_v3_action" inline="true">
660
- <field name="ACTION">turn_left</field>
661
- <next>
662
- <block type="hardware_smalrubot_v3_action" inline="true">
663
- <field name="ACTION">turn_right</field>
664
- <next>
665
- <block type="hardware_smalrubot_v3_action" inline="true">
666
- <field name="ACTION">stop</field>
667
- <next>
668
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
669
- <field name="ACTION">forward</field>
670
- <value name="SEC">
671
- <block type="math_number">
672
- <field name="NUM">0.5</field>
673
- </block>
674
- </value>
675
- <next>
676
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
677
- <field name="ACTION">backward</field>
678
- <value name="SEC">
679
- <block type="math_number">
680
- <field name="NUM">0.4</field>
681
- </block>
682
- </value>
683
- <next>
684
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
685
- <field name="ACTION">turn_left</field>
686
- <value name="SEC">
687
- <block type="math_number">
688
- <field name="NUM">0.3</field>
689
- </block>
690
- </value>
691
- <next>
692
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
693
- <field name="ACTION">turn_right</field>
694
- <value name="SEC">
695
- <block type="math_number">
696
- <field name="NUM">0.2</field>
697
- </block>
698
- </value>
699
- <next>
700
- <block type="hardware_smalrubot_v3_action_with_sec" inline="true">
701
- <field name="ACTION">stop</field>
702
- <value name="SEC">
703
- <block type="math_number">
704
- <field name="NUM">0.1</field>
705
- </block>
706
- </value>
707
- <next>
708
- <block type="ruby_p" inline="true">
709
- <value name="ARG">
710
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
711
- <field name="LOR">left</field>
712
- <field name="POR">pressed</field>
713
- </block>
714
- </value>
715
- <next>
716
- <block type="ruby_p" inline="true">
717
- <value name="ARG">
718
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
719
- <field name="LOR">left</field>
720
- <field name="POR">released</field>
721
- </block>
722
- </value>
723
- <next>
724
- <block type="ruby_p" inline="true">
725
- <value name="ARG">
726
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
727
- <field name="LOR">right</field>
728
- <field name="POR">pressed</field>
729
- </block>
730
- </value>
731
- <next>
732
- <block type="ruby_p" inline="true">
733
- <value name="ARG">
734
- <block type="hardware_smalrubot_v3_touch_sensor_pressed_or_released">
735
- <field name="LOR">right</field>
736
- <field name="POR">released</field>
737
- </block>
738
- </value>
739
- <next>
740
- <block type="ruby_p" inline="true">
741
- <value name="ARG">
742
- <block type="hardware_smalrubot_v3_light_sensor_value" />
743
- </value>
744
- <next>
745
- <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
746
- <field name="COLOUR">red</field>
747
- <field name="OOO">turn_on</field>
748
- <next>
749
- <block type="hardware_smalrubot_v3_led_turn_on_or_off" inline="true">
750
- <field name="COLOUR">green</field>
751
- <field name="OOO">turn_off</field>
752
- </block>
753
- </next>
754
- </block>
755
- </next>
756
- </block>
757
- </next>
758
- </block>
759
- </next>
760
- </block>
761
- </next>
762
- </block>
763
- </next>
764
- </block>
765
- </next>
766
- </block>
767
- </next>
768
- </block>
769
- </next>
770
- </block>
771
- </next>
772
- </block>
773
- </next>
774
- </block>
775
- </next>
776
- </block>
777
- </next>
778
- </block>
779
- </next>
780
- </block>
781
- </next>
782
- </block>
783
- </next>
784
- </block>
785
- </next>
786
- </block>
787
- </statement>
788
- </block>
789
- XML
790
- end
791
- end
792
454
  end