22 lines · 339 B · Text
RawDownload
// name: int-dist.ck// desc: testing int random distribution over range // how many buckets10 => int N; // bucketsint count[N]; // how many timesrepeat( 100000 ){    // which bucket?    count[Math.random2(0,N-1)]++;} // go over bucketsfor( int i; i < N; i++ ){    // print bucket contents    cherr <= count[i] <= IO.nl();}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t