Clarity and conciseness are highly correlated. In other words, short programs are usually (but not always) easier to understand than long programs. Your goal should almost always be to write the clearest, most easily understandable program that you can.
This time is different.
This time the goal is to write the shortest program you can to solve the given problem, even at the expense of clarity.
while), integers, floating point numbers, single punctuation marks (such as a bracket,
[), multiple-character operators (such as
When attempting this, I strongly recommend:
The winner will score 150 points; runners-up may score as much as 120 points. Correct, on-time programs longer than 2.25 times the length of the shortest program will receive 75 points.
A few years ago I assigned a highly simplified Bridge Game assignment, linked to here for your reference. But what you really should pay attention to is my version of the assignment, BridgeForScala.zip. I will also provide (it's not ready yet) a program to count symbols.
Your assignment is to translate this Java program into Scala, using the same classes and the same methods (that is, classes and methods use the same names, and methods use the same parameter lists). There is one exception: In the
Card class, use Scala-style getters, not JavaBean-style getters. That is, you should be able to say
card.value instead of
Pay attention to the grading scheme, because it's unusual.
Among the completely correct programs turned in by the due date,
min_lengthbe the length (as defined above) of the shortest completely correct program turned in by the due date
your_lengthbe the length of your program
Nbe a factor chosen by us (
20, unless we have reason to change it)
your_score = max(75, 100 + 2 * N - N * (your_length / min_length)).
For example, if the shortest program is 1000 symbols long, and your program is 1200 symbols long, then (with N = 20), your score would be
max(75, 100 + 40 - 20 * (1200/1000)) = max(75, 140 - 20 * 1.2) = 116
and if your program is 3000 symbols long, then your score would be
max(75, 100 + 40 - 20*(3000/1000)) = max(75, 140 - 20 * 3) = 80
Finally, the winner of the competition (shortest correct on-time program) will receive a bonus of 30 points. In the event of a tie, points will be distributed evenly.
Thus, grades for correct, on-time programs may range from 75 to 120 points. A completely correct program, with no deductions for style or lateness, will be worth 75 points, regardless of length.
Programs that are late or not completely correct will be graded on the basis of 75 points (not 100), with the usual kinds of deductions for failed tests and lateness.
Your program is due before 6am November 28. Zip up the entire directory for this project, and submit via Blackboard.