Laboratory: Language C++.
Time: Thursdays, 14-16.
Place: room 007.
Course Homepage
Link to Pawel Rzechonek's page.
Exercisies
-
Exercise number 4 .
-
Exercise number 5 .
-
Exercise number 6 .
-
Exercise number 7 .
You need assert.h ,
square.h ,
square.cpp ,
and the C-exercise nr8 .
-
Exercise number 8 is about solving
the
fifteen puzzle .
This is the task,
and this is some code that
you should use as starting point.
The aim of this exercise is that you become familiar with
some of the data structures in STL, namely
std::map and std::priority_queue.
-
Exercise number 9 about templates.
-
Last time I promissed a task about
Rubik Cube,
and here it is.
You need assert.h ,
rubik.cpp ,
rotation.h ,
sequence.h ,
sequence.cpp ,
cube.h ,
and
cube.cpp
This file contains explanation
of the notation that I use for rotations of the cube.
If you want to plot the state of a cube, you need switch on
the #if-s in the code, and use the
following makefile .
It works in room 7.
If you don't want to use graphics, use
this makefile .
-
Task 11 is to actually solve
the Rubik cube.
solve.h , and
solve.cpp are not able to solve
the cube, but they try very hard, and are able to fill up the memory
in your computer quickly.
This is a possible distance
function.
Some More Remarks
If you have a bad programming style, you will never be able to
write non-trivial programs or to work in a team. Therefore:
-
Names of variables and functions must be meaningful,
no names like h1, h2, help, tmp, etc.
-
You must use proper
indentation
.
-
You will not say 'but it works' as justification for bad code.
It usually means that you didn't test well enough.