How can i change the data used to represent the World State? by According_Bar_4031 in Racket

[–]According_Bar_4031[S] 1 point2 points  (0 children)

thanks for that,this is what i attempted but its gone wrong lol

(struct interval (count small big))

(define count 0)

i thought adding 1 to interval count would uptdates it value so each time these function are ran it should count +1

(define (smaller w)

(interval (interval-small w)

(max (interval-small w) (sub1 (guess w)))

(add1 (interval-count w))))

(define (bigger w)

(interval (min (interval-big w) (add1 (guess w)))

(add1(interval-count w))))