!759 !include #1002412 // Turing static void tests() { elements(); } static void elements() { repeat 5 { L l = randomList(); add(format3("how many elements are in the list *?", l), l(l)); } repeat 2 { L 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 randomList() { int n = rand(5); ret randomList(n, n); } static L randomList(int minLen, int maxLen) { int n = minLen + rand(maxLen-minLen+1); new L l; repeat n { l.add(randomID(1)); } ret l; }