Got a cloudy head this morning, so this could probably be done more simply, but this seems to work:

`assign("pts", 100*sqrt(n * bc) / (r + 1.0))`

assign("win", 300)

assign("win", if((n < 9) and (r < 5), pts, win))

assign("win", if((n > 8 ) and (n < 17) and (r < 6), pts, win))

assign("win", if((n > 16) and (r < 7), pts, win))

win