• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision1ded9fa974ce37041e6684e29adeef09a6296587 (tree)
Time2015-01-28 17:20:32
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Add: PIONE tutorial about Loop statement.
new file: SampleCode/PIONE/Basic15/EvenOddLoop4.pione

Change Summary

Incremental Difference

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