<s> from framework . latentmodule import LatentModule <EOL> import random <EOL> import time <EOL> class Main ( LatentModule ) : <EOL> def __init__ ( self ) : <EOL> LatentModule . __init__ ( self ) <EOL> self . speed = <NUM_LIT:2> <EOL> def run ( self ) : <EOL> self . write ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> watcher = self . watchfor_multiple_begin ( [ '<STR_LIT:a>' ] ) <EOL> vel = [ self . speed , <NUM_LIT:0> ] <EOL> pos = [ - <NUM_LIT> , <NUM_LIT> ] <EOL> ball = self . picture ( '<STR_LIT>' , duration = <NUM_LIT> , scale = <NUM_LIT> , pos = pos , block = False ) <EOL> now = time . time ( ) <EOL> t_end = now + <NUM_LIT:20> <EOL> while True : <EOL> dt = time . time ( ) - now <EOL> now = time . time ( ) <EOL> if now > t_end : <EOL> break <EOL> pos [ <NUM_LIT:0> ] += vel [ <NUM_LIT:0> ] * dt <EOL> pos [ <NUM_LIT:1> ] += vel [ <NUM_LIT:1> ] * dt <EOL> ball . setPos ( pos [ <NUM_LIT:0> ] , <NUM_LIT:0> , pos [ <NUM_LIT:1> ] ) <EOL> vel [ <NUM_LIT:0> ] = vel [ <NUM_LIT:0> ] * <NUM_LIT> ** dt <EOL> vel [ <NUM_LIT:1> ] = vel [ <NUM_LIT:1> ] * <NUM_LIT> ** dt - <NUM_LIT:2> * dt <EOL> if abs ( pos [ <NUM_LIT:0> ] ) > base . getAspectRatio ( ) : <EOL> vel [ <NUM_LIT:0> ] = abs ( vel [ <NUM_LIT:0> ] ) * ( - <NUM_LIT:1> if pos [ <NUM_LIT:0> ] > <NUM_LIT:0> else + <NUM_LIT:1> ) <EOL> if abs ( pos [ <NUM_LIT:1> ] ) > <NUM_LIT:1> : <EOL> vel [ <NUM_LIT:1> ] = abs ( vel [ <NUM_LIT:1> ] ) * ( - <NUM_LIT:1> if pos [ <NUM_LIT:1> ] > <NUM_LIT:0> else + <NUM_LIT:1> ) <EOL> self . sleep ( <NUM_LIT> ) <EOL> ball . destroy ( ) <EOL> results = self . watchfor_multiple_end ( watcher ) <EOL> self . write ( '<STR_LIT>' % str ( results [ '<STR_LIT:a>' ] ) , '<STR_LIT>' ) <EOL> self . write ( '<STR_LIT>' ) </s>
