We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Ping Pong

Many tech companies play ping pong in the office during break time. At Textio, we play virtual ping pong using channels.

Assignment

Run the code as-is. You should see that it doesn't do anything interesting: no ping or pong messages are printed.

Fix the bug in the pingPong function.

Remember: if a program exits before its goroutines have completed, those goroutines will be killed silently. Which of the function calls probably shouldn't run in the background as a goroutine?