set ch(minint) 5000
# unset always
-set always 0
+# set always 0
set nmrawhich 0
+set lastptchosen xx
set polmsg(l) 908000
set polmsg(x) 90f802
set segsasgot {xx yy}
set pq {} ;# unset: cdu charged and waiting
set speeddirn ff7f
-set speeddirn_fixed {speed126 2 60 0}
+set speeddirn_fixed {speed126 2 80 0}
set funcs ff7f
# unset pointpos($point)
# unset segdetect($seg) ;# unset: shown D0; {}: shown D1; or: after id, D1->0
pt_now immed $point $pos {}
set pq {}
}
+proc pt_ifthenmust {ifpoint ifposwant thenpoint thenpos} {
+ upvar #0 pointpos($ifpoint) ifpos
+ if {![info exists ifpos] || $ifpos != $ifposwant} return
+ pt_must $thenpoint $thenpos
+}
proc pm_charged {} {
global pq
}
proc pt_maybe {point oneisright} {
- global always
+ global always lastptchosen
if {[info exists always]} {
set pos $always
} else {
+ if {![string compare $point $lastptchosen]} return
+ set lastptchosen $point
set x [randbyte]
set pos [expr [regexp {^[89a-f]} $x] ? 1 : 0]
debug "chose point $point pos=$pos (x=$x)"
0b { pt_must "40 41 X8" 0 }
16 - 1c { pt_must "02 03 A5" 0 }
1a - 10 { pt_must "42 43 A6" 0 }
+ 14 { pt_ifthenmust "02 03 A5" 1 "42 43 A6" 1 }
+ 20 { pt_ifthenmust "42 43 A6" 1 "02 03 A5" 1 }
}
switch -exact [join $segs -] {
- 14-20 { pt_must "42 43 A6" 1 }
- 20-14 { pt_must "02 03 A5" 1 }
- }
- switch -exact [join $segs -] {
- 07-02 { pt_maybe "00 01 X7" 0 }
- 02-07 { pt_maybe "02 03 A5" 1 }
- 06-09 { pt_maybe "40 41 X8" 1 }
- 09-06 { pt_maybe "42 43 A6" 0 }
+ 02-07 { pt_maybe "00 01 X7" 0 }
+ 07-02 { pt_maybe "02 03 A5" 1 }
+ 09-06 { pt_maybe "40 41 X8" 1 }
+ 06-09 { pt_maybe "42 43 A6" 0 }
}
}