I need help with this code from makecode microsoft

I have this code here Cookie Test22323
and it keeps showing 0 on forever before it shows its number and i have no clue how to fix it,
Im using a microbit with the bbc inventors kit and also for some reasons theres a delay between the two micro-bits
this is my assignment, if anyone has any suggests or wanna do it for me thanksss