Challenge:
So given a die, the Pitch, Roll and Yaw, output which dice face is on top and also produce the dice layout with correct orientations of all the faces.
- Implement the follow Shared Function on your Die
Public Shared Function PRY(dieToUse As Die, pitches As Integer, rolls As Integer, yaws As Integer) As Die ' ... ' End Function
- Implement the following ReadOnly Property on your Die.
Which reveals the value of the top-most face
Public Read Only Propery Value() As Integer
- Override the ToString method to output the die in the follow format.
B LTR F P
B - Back
L - Left
T - Top
R - Right
F - Front
P - Posterior
An Example output of the canonical die starting arrangement.
+---+ |O | | | | O| +---+---+---+ |O O| |O | | | O | O | |O O| | O| +---+---+---+ |O O| | O | |O O| +---+ |O O| |O O| |O O| +---+
Output the dice is to be in the above style.
- Any die produced or used mustn't be changed or mutated.
Notes:
-Pitch is Pitching Forwards
+Pitch is Pitching Backwards
-Roll is Rolling to Left
+Roll is Rolling to Right
-Yaw is Anti-Clockwise
+Yaw is Clockwise
For Example ( Pitch=-1)
+---+
| |
| O |
| |
+---+---+---+
|O O|O O| O|
| | O | O |
|O O|O O|O |
+---+---+---+
|O O|
|O O|
|O O|
+---+
|O |
| |
| O|
+---+
Notice thee orientation change of the left and right faces.
Scoring
Instead of the normal code scoring rules of the lowest number of non-whitespace characters.
This challenge will be judges by the number of lines in your Die and it supporting codes (excluding the framework of course).
Entrants
- Winner will be the entry with the lowest score be the Start of next Month ( April 2012).
- SourceCode must be in spoilered code tags.
Spoiler - If you like you can include a Zip-File of the project / executable.
- vb.net solutions (are the preferred programming language)
Now go have some fun thinking and coding you entry.
This post has been edited by AdamSpeight2008: 08 March 2012 - 06:42 AM

New Topic/Question
Reply



MultiQuote







|