Game Development Reference
In-Depth Information
For example, if the input file contains the following two lines:
this IS an * %#$ example
of an input text file!
then the output should contain the following nine lines:
* %#$
IS
an
example
file!
input
of
text
this
In case this is too complicated, you can simplify the question as follows: use fixed
file names instead of names specified by the user; leave out the sorting and the
duplicate word removal; do not process the words, but the lines of the text; leave
out reporting the error .
2. Abstract classes and interfaces
What is the difference between an abstract class and an interface? Give an exam-
ple of a situation in which you would use an abstract class. Give another example
of a situation in which you would use an interface.
3. Tetris blocks
Suppose that you are working on creating a Tetris game. In that game, a tetris
block is represented by a two-dimensional array of boolean values. The first
dimension indicates the column, the second dimension indicates the row. For
example, here are two different tetris blocks:
true true false
false true false false
false true true
false true false false
false false false
false true false false
false true false false
(a) Write a method HorizontalMirror which receives as a parameter a two dimen-
sional array of booleans. The goal of the method is that the values of the array
are mirrored horizontally. After calling the method, the two blocks given as
an example above will appear as follows:
false true true false false true false
true true false false false true false
false false false false false true false
false false true false
For example, you could use this method as follows:
Search WWH ::




Custom Search