@name DDR - Croco
@inputs Sc:wirelink UP DOWN LEFT RIGHT
@outputs Reset
@persist HIT:string 
runOnTick(1)
timer("E",3000)
timer("reset",700)
if(clk("E")){E = randint(1,5)}
if(clk("reset")){Reset = 1}
else{Reset = 0}
if(E == 1){MOVE = "UP"}
if(E == 2){MOVE = "DOWN"}
if(E == 3){MOVE = "LEFT"}
if(E == 4){MOVE = "RIGHT"}
Sc:writeString("MOVE : "+ MOVE ,0,6 +0,600)
Sc:writeString("HIT?:" + HIT ,0,6 +1,600)

if(MOVE == "UP"){
if(UP == 1){
    HIT = "Yes!"
    UP = 0
}}
if(MOVE == "UP"){
if(UP != 1){
HIT = "Miss!"
}}
if(MOVE == "DOWN"){
if(DOWN == 1){
    HIT = "Yes!"
    UP = 0
}}
if(MOVE == "DOWN"){
if(DOWN != 1){
HIT = "Miss!"
}}
if(MOVE == "LEFT"){
if(LEFT == 1){
    HIT = "Yes!"
    UP = 0
}}
if(MOVE == "LEFT"){
if(LEFT != 1){
HIT = "Miss!"
}}
if(MOVE == "RIGHT"){
if(RIGHT== 1){
    HIT = "Yes!"
    UP = 0
}}
if(MOVE == "RIGHT"){
if(RIGHT != 1){
HIT = "Miss!"
}}

