Search code examples
mu

Line 48 syntax error


I'm trying to program a game type thing in mu. But when I run the program it says line 48 syntax error and it doesn't matter what I put there.

from microbit import *

while True:
    if button_a.is_pressed():
        i = 1
        while True:
            display.show(Image.HEART)
            sleep(2000)
            display.scroll('LOL')
            if button_a.is_pressed():
                for x in range(0, 10):
                    display.show(Image.HEART)
                    newheart = Image("09090:""99999:""99999:""09990:""00900")
                    display.show(newheart)
                    sleep(100)
                    dimheart = Image("06060:""66666:""66666:""06660:""00600")
                    display.show(dimheart)
                    sleep(100)
                    darkheart = Image("03030:""33333:""33333:""03330:""00300")
                    display.show(darkheart)
                    sleep(100)
                    black = Image("00000:""00000:""00000:""00000:""00000")
                    display.show(black)
                    sleep(500)
                    if button_a.is_pressed():
                        i = 1
                        while True:
                            display.show(Image.HEART)
                            newheart = Image("09090:""99999:""99999:""09990:""00900")
                            display.show(newheart)
                            sleep(100)
                            dimheart = Image("06060:""66666:""66666:""06660:""00600")
                            display.show(dimheart)
                            sleep(100)
                            darkheart = Image("03030:""33333:""33333:""03330:""00300")
                            display.show(darkheart)
                            sleep(100)
                            black = Image("00000:""00000:""00000:""00000:""00000")
                            display.show(black)
                            sleep(500)
                            if accelerometer.was_gesture('shake'):
                                display.show(Image.HEART)
                                sleep(500)
                                brokenheart = Image("09090:""96099:""99069:""09090:""00500")
                                display.show(brokenheart)
                                sleep(500)
                                sdust = Image("09090:""90909:""09090:""90909:""09090"
                                display.show(sdust)
                                sleep(500)
                                dust = Image("00000:""00000:""00600:""07970:""89998")
                                display.show(dust)
                                sleep(500)
                                i = x
                                whilst True:
                                    display.show(black)
    else:
        display.scroll('press and hold the A button')
        sleep(1000)

thanks, I'm just a beginner


Solution

  • I think the problem is this line

    sdust = Image("09090:""90909:""09090:""90909:""09090"
    

    You seem to be missing the ')' at the end