14 lines
395 B
Java
14 lines
395 B
Java
class IListProblem extends Object {
|
|
IList getList() {
|
|
return new IList(new IList(getList(), 1), 0);
|
|
}
|
|
// Premiere class table
|
|
Bool contains(IList arg) {
|
|
return ((Int)arg.head).eq(0).ite(true, this.contains(arg.tail));
|
|
}
|
|
// Seconde class table
|
|
Bool contains(IList arg) {
|
|
return ((Int)arg.head).eq(1).ite(true, this.contains(arg.tail));
|
|
}
|
|
}
|