OSDN Git Service

Add: PIONE tutorial to improve Loop Statement. v2.0.2p0083
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 9 Jan 2015 06:46:46 +0000 (15:46 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 9 Jan 2015 06:46:46 +0000 (15:46 +0900)
new file:   SampleCode/PIONE/Basic11/LoopTouch.pione
new file:   SampleCode/PIONE/Basic11/LoopTouch2.pione

SampleCode/PIONE/Basic11/LoopTouch.pione [new file with mode: 0644]
SampleCode/PIONE/Basic11/LoopTouch2.pione [new file with mode: 0644]

diff --git a/SampleCode/PIONE/Basic11/LoopTouch.pione b/SampleCode/PIONE/Basic11/LoopTouch.pione
new file mode 100644 (file)
index 0000000..fe609c7
--- /dev/null
@@ -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 (file)
index 0000000..2680419
--- /dev/null
@@ -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