From: Jérémie Astor Date: Sat, 8 Aug 2020 12:02:04 +0000 (+0200) Subject: :art: Update X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=238659816eeadc35dbd646cdf86a5ced2b3be5bd;p=gwion.git :art: Update --- diff --git a/docs/Reference/ControlFlow/forloop.mdr b/docs/Reference/ControlFlow/forloop.mdr deleted file mode 100644 index 345bdf71..00000000 --- a/docs/Reference/ControlFlow/forloop.mdr +++ /dev/null @@ -1,62 +0,0 @@ -# For Loops -**For** loops in Gwion is pretty similar to classic **C** syntax - -## basic loops -@``` forloop0.gw -for(int i; i < 3; ++i) - <<< i >>>; -@``` -@hide make -s forloop0.test - -It also works with a block of code. - -@``` forloop2.gw -for(int i; i < 3; ++i) { - i/2 => float f1; - i/2. => float f2; - <<< i, " " , f1, " ", f2 >>>; -} -@``` -@hide make -s forloop2.test - -## Nested Loops -@``` forloop3.gw -int array[3][4]; - -for(int i; i < 3; ++i) { - for(int j; j < 4; ++j) { - <<< array[i][j] >>>; - } -} -@``` -@hide make -s forloop3.test - -### Auto Loops - -#### Simple auto loop -@``` forloop4.gw -int array[2][3]; -for(auto a: array) { - <<< a >>>; - for(auto b: a) - <<< b >>>; -} -@``` -@hide make -s forloop4.test - -### Auto Pointer loop -If you want to change it the value in the array, you need a pointer - -@``` forloop5.gw -int array[2][3]; -int i; -for(auto a: array) { - for(auto ref b: a) - <<< ++i => *b >>>; -} -for(auto a: array) { - for(auto ref b: a) - <<< *b >>>; -} -@``` -@hide make -s forloop5.test diff --git a/docs/Reference/ControlFlow/list b/docs/Reference/ControlFlow/list index 8e358367..b7f532d8 100644 --- a/docs/Reference/ControlFlow/list +++ b/docs/Reference/ControlFlow/list @@ -1,6 +1,4 @@ README.md -ControlFlow.md -forloop.md -Loops.md +ForLoop.md Repeat.md whileuntil.md