Libraryless. Click here for Pure Java version (1920L/14K/43K).
!759 !include #1002412 // Turing static void tests() { elements(); } static void elements() { repeat 5 { L<S> l = randomList(); add(format3("how many elements are in the list *?", l), l(l)); } repeat 2 { L<S> l = randomList(2, 4); add(format3("what is the first element in the list *?", l), first(l)); add(format3("what is the last element in the list *?", l), last(l)); add(format3("what is the 2nd element in the list *?", l), get(l, 1)); } } static L<S> randomList() { int n = rand(5); ret randomList(n, n); } static L<S> randomList(int minLen, int maxLen) { int n = minLen + rand(maxLen-minLen+1); new L<S> l; repeat n { l.add(randomID(1)); } ret l; }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment