Waypoints at powers of (sqrt 2)

This commit is contained in:
Tony Garnock-Jones 2015-03-18 16:15:23 -04:00
parent 79b88418de
commit 2f8a6482c1
1 changed files with 15 additions and 8 deletions

View File

@ -53,14 +53,21 @@
;; We work our way through these waypoints: start with one connection,
;; then 10, then 20, etc etc until we reach the end.
(define waypoints
(list 1 10 20 30 40 50 60 70 80 90 100 120
150 200 210 220 230 240 250 260 270 280 290 300 400
500 600 700 800 900
;; Here on up, increase by ~1.2× each time
1000 1200 1440 1728 2073
2488 2985 3583 4299 5159
6191 7430 8916 10699 12839
15407 18488 22186 26623))
(list* 1 2 5
(let loop ((n 10))
(if (>= n 30000)
'()
(cons (inexact->exact (truncate n))
(loop (* n (sqrt 2)))))))
;; (list 1 10 20 30 40 50 60 70 80 90 100 120
;; 150 200 210 220 230 240 250 260 270 280 290 300 400
;; 500 600 700 800 900
;; ;; Here on up, increase by ~1.2× each time
;; 1000 1200 1440 1728 2073
;; 2488 2985 3583 4299 5159
;; 6191 7430 8916 10699 12839
;; 15407 18488 22186 26623)
)
;; We exchange pings with the server for this many milliseconds before
;; moving up to the next waypoint.