Assignment 1 – A memo, a first small program and a first attempt to design
1 The memo
2 The small program
3 And the design attempt

Assignment 1 – A memo, a first small program and a first attempt to design

Due Thursday 10/4 12am

1 The memo

Your first task is to write a memo to justify the selection of the language your team will work with for the rest of the quarter. It is always a wise choice to pick a language you already know well and you are confident that it is a good fit for the project you are working on. Here is what you know about what the project demands from your language of choice: (i) support for running programs on the school’s lab machines (UNIX) and your laptops from the command line with a single command without code changes; (ii) support for UNIX-style STDIN, standard I/O and TCP/IP sockets; (iii) modular programming (think modules, functors, packages etc.); (iv) reading and writing JSON; (v) loading code dynamically; (vi) automatic unit testing and test coverage and (vii) an IDE with support for exploratory programming. Your memo should justify your linguistic choice given these requirements and it should be at most one page long. The title of the memo should be "Programming Language for the Next Unicorn" and should be addressed to "Overlord Founder of our Precious Startup".

Deliverables: In your team’s GitHub repository, first create a directory named "Deliverables" and then inside it create another directory named "1". Finally create inside "1" a directory "1.1" and place there a PDF named "memo.pdf".

2 The small program

Your second task is to develop a program that reads a stream of JSON values from STDIN until the input stream is closed (^D) and then prints them back in STDOUT after some light processing. The input values must be printed in reverse order and embedded in a JSON object with two fields: (i) a field named "index" that holds the order the value appeared in the input stream and (ii) a field named "value" that holds the value itself. The output JSON objects must be separated by a new line. The goal of this task is to make you test whether you have chosen the right language. If working on this task makes you reconsider your choice, go back and revise your memo.

Deliverables: In your team’s GitHub repository, in "Deliverables/1" create a directory "1.2" and place there three files: (i) either a Unix/Linux executable "runme" or a bash script "runme" for this task; (ii) five files "inputX" where X is 1 to 5 that each contains a list of JSON values that can be fed to deliverable (i) from the command line (with Unix redirection) and (iii) five files "outputX" that each contains the expected output of deliverable (i) on "inputX" from deliverable (ii).

3 And the design attempt

Your final task is to design the interface between two modules of a game application. In particular the "Overlord Founder of our Precious Startup" has decided to conquer the world with an implementation of a simple but addictive game. The rules of the game are the following: (i) the player declares a number between 1 and 10; (ii) the administrator selects a card from a pile of cards each with a number between 1 and 10 and places it face down on the table; (iii) the player can either pick the card on the table or keep their number; (iii) the administrator reveals the card; (iv) the player wins if their choice is the one with the bigger number. The "Overlord Founder of our Precious Startup" has decided to outsource the implementation of a player module in a distant country. Your teams assignment is to give to the contractors a detailed enough description of what operations the player module must implement so that you can link their module with an administrator module developed in-house to form a complete game.

Deliverables: In your team’s GitHub repository, in "Deliverables/1" create a directory "1.3" and place there a PDF named "interface.pdf".