let c=a=>console.log(a)
let p=b=>prompt(b)
let m=n=>Math.floor(Math.random()*n)+1
let d=c=>console.log('==============================')
let g=m(6)
let f=0
let s=-1
let l=['ACE','CONDOR','ALBATROSS','EAGLE','BIRDIE','PAR','BOOGEY']
d()
c("try to put into your goal")
c('when you see = put')
c('put your strength by entering 1,2,3')
c('missing a = counts as a stroke')
d()
if(g>3)c('It looks far')
else c('It looks close')
while(g!==0){
if(f (less than) 4||f>0){
if(5===m(10)+1){f=p('=')
if(g (less than) f){c('Too far, You overshoot')
g=f-g}
else g=g-f}
else{p('#')
s=s-1
}
s++}
else if(f='')s++
else c('input INVALID')
}
d()
c('You did it!')
c(`You got ${l[s]}`)
d()
My second homework was to make it very short. Below 1000 characters short. It's a simple reaction game, you shoot with different strengths when you see a = you miss if you do it on a #.