:- consult('plnxt/plnxt.pl'). is_touched :- nxt_touch(Value), Value = 1. is_loud :- nxt_sound(Value), Value > 50. is_white :- nxt_light(Value,force), write('Light: '), write(Value), nl, Value > 45. follow_the_white_rabbit :- nxt_stop, nxt_go(100), wait_till(not(is_white)), follow_line. follow_line :- nxt_stop, nxt_go(100), wait_till(is_white), turn_right. turn_right :- nxt_stop, nxt_rotate(200,20,force), follow_line. start :- nxt_light_LED(activate), trigger_create(_,is_touched,[quit]), follow_the_white_rabbit. quit :- trigger_killall, nxt_stop.