Loops/Nested: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 257:
=={{header|Amazing Hopper}}==
<syntaxhighlight lang="
#include <jambo.h>
Line 272:
Loop for ( j=1, #(j<=DIMS), ++j)
When ( Equals ( 20, [i,j] Get 't' ---Copy to 'aux'---) ) { Break }
/*
Also: When( #( ((aux:= (t[i,j])) == 20) ) ) { Break }
*/
Just right (3, Str(aux)), Print only if ( #(DIMS-j), "," )
Next
Line 4,606 ⟶ 4,609:
{{libheader|Wren-fmt}}
Wren doesn't have ''goto'' or ''break label'' so to break out of nested loops you need to use a flag (''found'' in the code below).
<syntaxhighlight lang="
import "./fmt" for Fmt
var rand = Random.new()
Line 4,620 ⟶ 4,623:
for (i in 0..19) {
for (j in 0..19) {
if (a[i][j] == 20) {
found = true
|