From ace6f6f42c677fd2598120227dc8952dd269d542 Mon Sep 17 00:00:00 2001 From: kinoshita-eos Date: Fri, 9 Jan 2015 15:46:46 +0900 Subject: [PATCH] Add: PIONE tutorial to improve Loop Statement. new file: SampleCode/PIONE/Basic11/LoopTouch.pione new file: SampleCode/PIONE/Basic11/LoopTouch2.pione --- SampleCode/PIONE/Basic11/LoopTouch.pione | 24 ++++++++++++++++++++++++ SampleCode/PIONE/Basic11/LoopTouch2.pione | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 SampleCode/PIONE/Basic11/LoopTouch.pione create mode 100644 SampleCode/PIONE/Basic11/LoopTouch2.pione diff --git a/SampleCode/PIONE/Basic11/LoopTouch.pione b/SampleCode/PIONE/Basic11/LoopTouch.pione new file mode 100644 index 0000000..fe609c7 --- /dev/null +++ b/SampleCode/PIONE/Basic11/LoopTouch.pione @@ -0,0 +1,24 @@ +param $max := 64 + +Rule Main + output '*.txt' +Flow + rule LoopSystem {val: 0} +End + +Rule LoopSystem + output '*.txt' + param $val +Flow + rule Test {val: $val} + if ($val + 1) <= $max + rule LoopSystem {val: $val + 1} + end +End + +Rule Test + output '{$val}.txt' + param $val +Action + touch {$O[1]} +End \ No newline at end of file diff --git a/SampleCode/PIONE/Basic11/LoopTouch2.pione b/SampleCode/PIONE/Basic11/LoopTouch2.pione new file mode 100644 index 0000000..2680419 --- /dev/null +++ b/SampleCode/PIONE/Basic11/LoopTouch2.pione @@ -0,0 +1,27 @@ +param $max := 64 + +Rule Main + output '*.txt' +Flow + rule LoopSystem {val: 0} +End + +Rule LoopSystem + output '*.txt' + param $val +Flow + rule Test {val: $val} + if (($val * 2) + 1) <= $max + rule LoopSystem {val: ($val * 2) + 1} + end + if (($val * 2) + 2) <= $max + rule LoopSystem {val: ($val * 2) + 2} + end +End + +Rule Test + output '{$val}.txt' + param $val +Action + touch {$O[1]} +End \ No newline at end of file -- 2.11.0