Loops/Break: Difference between revisions

Content added Content deleted
(GDScript)
(Jakt)
Line 1,889: Line 1,889:
label_done.
label_done.
}}</syntaxhighlight>
}}</syntaxhighlight>

=={{header|Jakt}}==
The random number generation is slightly biased, but negligible for the purpose of the task.

<syntaxhighlight lang="jakt">
fn random(mut random_source: File = File::open_for_reading("/dev/urandom")) throws -> u64 {
mut buffer = [0u8; 4]
random_source.read(buffer)
mut result = 0u64
for byte in buffer {
result <<= 8
result += byte as! u64
}
return result
}

fn main() {
while true {
let n = random() % 20
println("{}", n)
if n == 10 {
break
}

println("{}", random() % 20)
}
}
</syntaxhighlight>


=={{header|Java}}==
=={{header|Java}}==