From 3c71c22739027c263d833b6e124a3cbec5deec7a Mon Sep 17 00:00:00 2001 From: Vinicius Silva Date: Mon, 25 Dec 2023 12:06:33 -0300 Subject: [PATCH] Tradicional for and Label for implemented --- 06_repetitions/for.v | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/06_repetitions/for.v b/06_repetitions/for.v index d70c931..753cade 100644 --- a/06_repetitions/for.v +++ b/06_repetitions/for.v @@ -89,6 +89,33 @@ pub fn main() { } println(num) + + // ==================================== // + + for k := 0; k < 10; k += 2 { + if k == 6 { + continue + } + + println(k) + } + + // ==================================== // + + outer: for j := 4; true; j++ { + println(j) + + for { + if j < 7 { + continue outer + }else { + break outer + } + } + } + + // ==================================== // + }