| 224 | }; |
| 225 | |
| 226 | function Rec() { |
| 227 | var curplace = Places[treepos]; |
| 228 | var tmp; |
| 229 | if (debug) |
| 230 | util.debug("len: " + len + " treepos: " + treepos) |
| 231 | if(len==17) { //war 17 |
| 232 | return -1; |
| 233 | } |
| 234 | treepos++; |
| 235 | len++; |
| 236 | |
| 237 | tmp = IsPat(); |
| 238 | if (debug) |
| 239 | util.debug("IsPat " + tmp) |
| 240 | if(tmp >= 0) { |
| 241 | curplace.b0 = tmp; /* leaf cell for 0-bit */ |
| 242 | if (debug) |
| 243 | util.debug("b0 " + curplace.b0) |
| 244 | } else { |
| 245 | /* Not a Leaf cell */ |
| 246 | curplace.b0 = 0x8000; |
| 247 | if (debug) |
| 248 | util.debug("b0 " + curplace.b0) |
| 249 | if(Rec()) |
| 250 | return -1; |
| 251 | } |
| 252 | tmp = IsPat(); |
| 253 | if(tmp >= 0) { |
| 254 | curplace.b1 = tmp; /* leaf cell for 1-bit */ |
| 255 | if (debug) |
| 256 | util.debug("b1 " + curplace.b1); |
| 257 | curplace.jump = null; /* Just for the display routine */ |
| 258 | } else { |
| 259 | /* Not a Leaf cell */ |
| 260 | curplace.b1 = 0x8000; |
| 261 | if (debug) |
| 262 | util.debug("b1 " + curplace.b1); |
| 263 | curplace.jump = Places[treepos]; |
| 264 | curplace.jumppos = treepos; |
| 265 | if(Rec()) |
| 266 | return -1; |
| 267 | } |
| 268 | len--; |
| 269 | return 0; |
| 270 | }; |
| 271 | |
| 272 | function CreateTree(currentTree, numval, lengths, show) { |
| 273 | var i; |