sub Positions() // select which switches are "IN PLay"
// set all players false until they press their button
Player1=false
Player2=false
Player3=false
Player4=false
Player5=false
Player6=false
Player7=false
// whatever this is supposed to do, it was done for any switch press
// so might as well just do it here. it likely doesn't work anyway
Switch(T)=index +1
// stay in this loop until switch 8 = 0
while (pos8 = 1)
IF pos1=0 THEN
Player1=true
play1=1 // turn on led (assuming it's an output)
DELAYMS(1000)
play1=0
END IF
IF pos2=0 THEN
Player2=true
play2=1
DELAYMS(1000)
play2=0
END IF
IF pos3=0 THEN
Player3=true
play3=1
DELAYMS(1000)
play3=0
END IF
IF pos4=0 THEN
Player4=true
play4=1
DELAYMS(1000)
play4=0
END IF
IF pos5=0 THEN
Player5=true
play5=1
DELAYMS(1000)
play5=0
END IF
IF pos6=0 THEN
Player6=true
play6=1
DELAYMS(1000)
play6=0
END IF
if pos7=0 THEN
Player7=true
play7=1
DELAYMS(1000)
play7=0
END IF
end while
// signal that we saw switch 8 low and we're exiting
play8=1
delayms(3000)
play8=0
delayms(500)
end sub