import time
import random
from machine import I2C, SoftI2C, Pin
from pico_i2c_lcd import I2cLcd
i2c=SoftI2C(sda=Pin(1), scl=Pin(3), freq=400000)
lcd_addr = i2c.scan()[0]
lcd=I2cLcd(i2c, lcd_addr, 2, 16)
row=1
col=0
while(1):
c=int(random.uniform(0, 2)) #[0,2]
r=int(random.uniform(0, 16)) #[0, 16]
print(c)
lcd.move_to(r, c)
lcd.putstr("*")
time.sleep(0.5)
if(r==row and c==col):
lcd.putstr("You WON!")
time.sleep(2)
break
# lcd.clear()
lcd.clear()