243 |
if not t.empty then begin |
if not t.empty then begin |
244 |
if t.outpos >= t.inpos then reformat t; |
if t.outpos >= t.inpos then reformat t; |
245 |
let rec iter t i j = |
let rec iter t i j = |
246 |
(* Printf.printf "i=%d j=%d inpos=%d outpos=%d\n" |
(* Printf2.lprintf "i=%d j=%d inpos=%d outpos=%d\n" |
247 |
i j t.inpos t.outpos; print_newline (); *) |
i j t.inpos t.outpos; print_newline (); *) |
248 |
if i >= t.inpos then |
if i >= t.inpos then |
249 |
(if i > j then begin |
(if i > j then begin |
256 |
iter t (i+1) j |
iter t (i+1) j |
257 |
else begin |
else begin |
258 |
if i > j then begin |
if i > j then begin |
259 |
(* Printf.printf "Move i=%d at j=%d" i j; print_newline (); *) |
(* Printf2.lprintf "Move i=%d at j=%d" i j; print_newline (); *) |
260 |
t.array.(j) <- ee; |
t.array.(j) <- ee; |
261 |
end; |
end; |
262 |
iter t (i+1) (j+1) |
iter t (i+1) (j+1) |
285 |
;; |
;; |
286 |
|
|
287 |
while true do |
while true do |
288 |
Printf.printf "%d\n" (Fifo.take t) |
Printf2.lprintf "%d\n" (Fifo.take t) |
289 |
done;; |
done;; |
290 |
|
|
291 |
*) |
*) |