changeset 53:0f8adc187d29

allWithMaxSize seems to work, will clean next commit
author William Morgan <bill@mrgn.org>
date Sun, 11 Aug 2013 13:48:35 -0700
parents 0ea0bae24173
children 42930b0904b1
files src/bv.tp
diffstat 1 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/bv.tp	Sun Aug 11 05:55:28 2013 -0700
+++ b/src/bv.tp	Sun Aug 11 13:48:35 2013 -0700
@@ -518,6 +518,18 @@
 					allOfSize: size inFold?: 0 withOps: ops
 				}
 
+				allWithMaxSize <- :size {
+					res <- #[]
+					n <- 3
+					while: {n <= size} do: {
+						foreach: (allOfSize: n) :idx el{
+							res append: el
+						}
+						n <- n + 1
+					}
+					res
+				}
+
 				filterTrees <- :trees strops {
 					filtered <- #[]
 					ops <- strops fold: 0 with: :acc el {
@@ -557,7 +569,18 @@
 			}
 		}
 
-		main <- :args {
+		main <- {
+			prog <- program
+			trees2 <- prog allWithMaxSize: 4
+			foreach: trees2 :idx tree {
+				prog root!: tree
+				test: prog
+			}
+			//print: trees2
+			0
+		}
+ 
+		mmain <- :args {
 			//test: (program gentestprog)
 			//test: (program exampleprog)
 			size <- 3
@@ -582,7 +605,7 @@
 					trees <- (prog allOfSize: size)
 				}
 				foreach: trees :idx tree {
-					prog root! tree
+					prog root!: tree
 					test: prog
 				}
 			}
@@ -590,3 +613,4 @@
 		}
 	}
 }
+