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 Pharo9 or Pharo10 image. If you don't yet have Pharo installed, see the Smalltalk resource page to download it.
The application is a simple orbit calculation described here.
My solution has 15 methods in 2 classes for a total of 66 non-blank lines of code (not counting tests). Because of the Smalltalk environment and the fact that Test-Driven-Design is so natural in Smalltalk, I completed this in about 30 minutes. In addition to the specifications there, the following Smalltalk-specific parameters will apply:
- To set up your fossil the first time, see the fossil page. Once you open the fossil, you will see that there are directories and frameworks already set up for all 3 assignments.
-
If there is Smalltalk code in the repository that you have not brought into your image (which is true this time, but unless you are running Pharo on 2 different computers, unlikely to happen again), you must initialize
git
for your repository. Of course, you have to havegit
installed on your computer. From the main directory (the one with the A1, A2, A3 directories in it):rm -rf .git git init git add .project A1 git commit -m 'initial setup'
-
Call your main class
Orbits
. -
Your
Orbits
instances must have afrom:
method that accepts a string which contains the whole mult-line input and returns the result string. YourOrbits
class must also have afrom:
method that creates an instance of itself and returns the result of sending it the string. - Note the Smalltak version (the one for this semester) does not do anything with files. The only interface is that described above.
-
Put your ownership information (see the assignment page) in a file called
A1/Ownership.txt
. - There are tests in the fossil repository, which you will see when you import the repository into Iceberg. You should run the test (click on the little circle beside the method name) and start building your answer.
You should do your assignment in the your Fossil CPS506
repository in the provided packages using Iceberg.
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.
You don't have to commit with a particular fossil comment - we'll mark the last commit before the due date - however if you commit with a comment something like "Mark this A1 even though it's late", we will mark that even if it's late.
Remember to do fossil status
and fossil ext
from somewhere within the repository periodically to make sure you're commiting all of your code (should only be necessary if you add a class).
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 cps506 fossil ci -m "finished code and tests for distance calculation"