Question: Conway's Problem: Write a program to read 80-column cards and write them as 125-character lines with the following changes. After every card image the string

Conway's Problem: Write a program to read 80-column cards and write them as 125-character lines with the following changes. After every card image the string is inserted. Every adjacent pair of asterisks ** is replaced by a #. The problem has an elegant solution with three concurrent processes. One process producer reads cards and inserts the string when necessary and passes characters through a one-character buffer to a process squash. squash, which knows nothing about 80-column cards, simply looks for double asterisks and passes a stream of modified characters to a process print. print takes the characters and prints them as 125-character lines. Write a program to solve Conway's problem with three separate processes for the producer, squasher and printer as described above using three concurrent processes with the following modifications: - Your program should read in the card text from a file called lab5.txt - Each card is 20 characters long (not 80 column cards). - To simulate card input read from a file where each line has 20 characters. - Printer process: prints 25-character lines to the screen (not 125 character lines).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!