Space invaders: repeat

Im stuck in this exercise, it request the code to have only 7 lines, my best was 8.
repeat(5){
repeat(2){
move()
}
repeat(3){
shoot()
}
}

this was my best

Can this be done in two lines?

1 Like

got it, thank you :folded_hands:

1 Like

You also don’t need to use the second nested repeat loop:

repeat(3) {
  shoot()
}

uses the same number of lines of code as:

shoot()
shoot()
shoot()
1 Like