An implementation of Peterson's distributed leader election algorithm
Input is redirected from a text file, where the first number is the number of nodes in the ring. An example input file is included. Distributed computing is simulated using channels. Synchronization and mutual exclusion are implemented using semaphores.