26 lines · 416 B · Text
RawDownload
// example reversing the order of an array// version: need chuck-1.5.0.0 or higher // an array[1,2,3,4,5] @=> int a[]; // print array in-orderprint_arr(a); // reversea.reverse(); // print reversed orderprint_arr(a); // return to original ordera.reverse();print_arr(a);  fun void print_arr(int a[]) {    for (0 => int i; i < a.size(); i++) {        cherr <= a[i] <= " ";     }    cherr <= 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