SUB RBOX ( x%, y%, w%, h%, r%, a%, m% )
    IF r% > w% THEN r% = w%
    IF r% > h% THEN r% = h%
    DIM i%, d1$, d2$, a1%, a2%, xp%, yp%, AA%, A#, s%(1 TO 4, 0 TO 1), e%(1 TO 4, 0 TO 1), s#
    s# = NVL( CHOOSE( m%, 90, 45, 30 ), 0 ) : s# = MAX( s#, 1 )
    RboxData: DATA "U", "L", 0, 90, "U", "R", 270, 360, "D", "L",  90, 180, "D", "R", 180, 270
                 '| TopLeftCircle  | TopRightCircle    | BottomLeftCircle  | BottomRightCircle |
    RESTORE RboxData
    FOR i% = 1 TO 4
        READ d1$, d2$, a1%, a2%
        DRAW "B TA" + a% + " M" + x% + "," + y% + "B "+ d1$ + ( h% - r% ) + "B " + d2$ + ( w% - r% )
        xp% = POINT(0) : yp% = POINT(1)
        LET bFirst% = TRUE
        FOR A# = a1% TO a2% STEP s#
          DRAW "B M" + xp% + "," + yp% + "B TA" + ( A# + a% ) + " U" + r%
          IF A# = a1% THEN
                 s%(i%,0) = POINT(0) : s%(i%,1) = POINT(1)
                 e%(i%,0) = POINT(0) : e%(i%,1) = POINT(1)
                 LINE ( e%(i%,0), e%(i%,1) ) TO ( s%(i%,0), s%(i%,1) )
             ELSE
                 LINE ( e%(i%,0), e%(i%,1) ) TO ( POINT(0), POINT(1) )
                 e%(i%,0) = POINT(0) : e%(i%,1) = POINT(1)
          END IF
          PSET ( POINT(0), POINT(1) )
        NEXT A#
    NEXT i%
    LINE ( e%(1,0), e%(1,1)) TO ( s%(3,0), s%(3,1))
    LINE ( e%(3,0), e%(3,1)) TO ( s%(4,0), s%(4,1))
    LINE ( e%(4,0), e%(4,1)) TO ( s%(2,0), s%(2,1))
    LINE ( e%(2,0), e%(2,1)) TO ( s%(1,0), s%(1,1))

END SUB

SCREEN _NEWIMAGE( 451, 281 ,17 )

COLOR 62

FOR i% = 0 TO 3
    CLS
    RBOX ( 225, 125, 220, 110, 40, 0, i% )
    RBOX ( 225, 125, 210, 100, 35, 358, i% )
    RBOX ( 225, 125, 200, 90, 35, 356, i% )
    PAINT (8,110), 1, 62
    PAINT (20,110), 2, 62
    PAINT (30,110), 3, 62
    LOCATE 17, 1
    PRINT "Touch/click the screen to continue.";
    SLEEP
NEXT i%