This assignment is a relatively simple program to capture various aspects of programming languages. We will work on versions of the program using 4 different languages. We will start with Smalltalk. You may use any classes that are in the default Pharo7 image.
The application is a simple Contract Bridge bidding simulation described here. In addition to the specifications there, the following Smalltalk-specific parameters will apply:
-
Call your main class
BidBridge
. -
Your
BidBridge
instance must have awithPermutation:
method that accepts anOrderedCollection
orArray
. The collection may be shorter than 52 elements, in which case simply play with the smaller deck (this is useful for tests). -
Your
BidBridge
instance may have aplay:
method that generates a random permutation of the numbers 1..52 and calls the above method. -
Your
BidBridge
instance must have aprintOn:
method that accepts a writeStream and prints the current state of the board on that stream. You should send a#flush
as the last message to the stream so that if it is a Transcript, the result will appear. This allows it to be converted to a string withasString
or printed on a file or aTranscript
. -
Put your ownership information (see the assignment page) in a file called
Assign1/Ownership.txt
. - There are tests in the Fossil repository.
- Here is a trivial example in a playground:
g:=BidBridge new. g withPermutation: #( 1 2 3 4 5 6 7 8 ). g printOn: Transcript. String streamContents: [: s | g printOn: s]
You should do your assignment in the your Fossil CPS506
repository in a package saved as a FileTree (in Montecello) called Assignment1
inside the Assign1
directory/folder.
Every time you have completed a part of the assignment, you should commit it to the repository.
You shouldn't wait until everything is complete to do this, it's better to check in regularly.
Remember to do fossil status
and fossil ext
from somewhere within the repository periodically to make sure you're commiting all of your code.
Also remember to not add binary files or other files that can be generated from the source.
You can so a fossil addremove
as many times as you want, but you only have to do it once each time there are new files to be included in the repository.
In a terminal/command window simply change to the working directory and check-in, for example:
cd fossil/cps506 fossil ci -m "finished code and tests for bridge bidding"