In task flash, you are given a command line program "tester" to help you test your solutions. The attachment tester.zip in CMS contains both a compiled executable and the C++ source code.

To see how many times your program is able to write in the first subtask, you can do:
$ ./tester <prog> -b 16 -m 8 -n 100
For C and C++, <prog> is flash
For Python, <prog> is /usr/bin/python3 flash.py
For Java, <prog> is /usr/bin/java flash

By default, tester will start 4 instances of your program, 2 as writers and 2 as readers. The writers are numbered 0, 1 and the readers 2, 3. It will stop and give an error message if your program makes an invalid write on incorrect read.

This tester does not enforce memory and time limits. It may also order writing and reading operations differently from the grader in CMS. 

Advanced features:

You can use the -v option to see all the communication to and from your instances.
For messages sent to your instances:
<id> <- <line>
For messages received to from your instances:
<id> -> <line>
Here <id> is the number of your instance.

You can write a copy of the input sent to instance 1 into file 1.in with
$ ./tester <prog> -b 16 -m 8 -n 100 -1 1.in
This is useful for debugging. If your programm is deterministic, you can rerun it directly with this file as stdin.
