Example A Simple Maze Game

I have a soft spot in my heart for curses because I have spent more time than I care to admit playing ASCII-based games such as Angband and Nethack. The program shown in Listing 22-5 is far simpler, but it does use several curses features. It uses a pad to hold a large maze, which the user can move around in. import curses import curses.ascii import whrandom Possible contents of maze-squares Attributes for displaying maze squares MAZE_ENTRANCE curses.A_BOLD, MAZE_HALLWAY curses.A_DIM, Simple...

Example A Multicast Chat Application

The example in this section combines material from several chapters to create a chat application that also enables you to draw on a shared whiteboard, as shown in Figure 15-1. Figure 15-1 The chat whiteboard application in action Figure 15-1 The chat whiteboard application in action Instead of using a client server model, the program uses multicast sockets for its communication. When you send a message to a multicast address (those addresses in the range from 224.0.0.1 to 239.255.255.255,...