From 7890b8cef2c330ad69e2ce5861931ff2768d6194 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 20 May 2016 12:47:18 -0700 Subject: 2986 - new example: the 8-queens problem Just playing around with edit/ and trying to find bugs. --- 074list.mu | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '074list.mu') diff --git a/074list.mu b/074list.mu index 5244deec..79fed038 100644 --- a/074list.mu +++ b/074list.mu @@ -47,6 +47,15 @@ scenario list-handling [ ] ] +def length l:address:list:_elem -> result:number [ + local-scope + load-ingredients + return-unless l, 0 + rest:address:list:_elem <- rest l + length-of-rest:number <- length rest + result <- add length-of-rest, 1 +] + def to-text in:address:list:_elem -> result:address:array:character [ local-scope load-ingredients -- cgit 1.4.1-2-gfad0