• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revisiona3d3cfe65d9f7e296952d54b06f222e4b4dab1ec (tree)
Time2015-01-05 11:46:09
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Add: PIONE tutorial for Loop
new file: SampleCode/PIONE/Basic10/EvenOddLoop.pione

Change Summary

Incremental Difference

--- /dev/null
+++ b/SampleCode/PIONE/Basic10/EvenOddLoop.pione
@@ -0,0 +1,45 @@
1+param $maxval := 456
2+param $minval := 123
3+param $dval := 37
4+
5+Rule Main
6+ output '*.txt'
7+Flow
8+ rule LoopSystem {val: $minval}
9+End
10+
11+Rule LoopSystem
12+ output '*.txt'
13+ param $val
14+Flow
15+ if $val <= $maxval
16+ rule EvenOdd {val: $val}
17+ end
18+ if ($val + $dval) <= $maxval
19+ rule LoopSystem {val: $val + $dval}
20+ end
21+End
22+
23+Rule EvenOdd
24+ output '*.txt'
25+ param $val
26+Flow
27+ if $val % 2 == 0
28+ rule Even {val: $val}
29+ else
30+ rule Odd {val: $val}
31+ end
32+End
33+
34+Rule Even
35+ output '*.txt'
36+ param $val
37+Action
38+ echo "{$val} is even." >> Even{$val}.txt;
39+End
40+
41+Rule Odd
42+ output '*.txt'
43+Action
44+ echo "{$val} is odd." >> Odd{$val}.txt;
45+End
\ No newline at end of file
Show on old repository browser