C-cards Starter Kit All you need is here! c-cardsdev.sf.net Andrea Valente Aalborg University in...

Post on 25-Dec-2015

222 views 0 download

Tags:

Transcript of C-cards Starter Kit All you need is here! c-cardsdev.sf.net Andrea Valente Aalborg University in...

C-cards Starter KitAll you need is here!

c-cardsdev.sf.net

Andrea Valente

Aalborg University in Esbjerg - DK

email: av@cs.aue.auc.dk

homepage: www.cs.aue.auc.dk/~av

June 2005

What are c-cards?

• Computational cards are a graphic formalism to express simple computational systems.

• The central idea of the c-cards project is that, introducing children very early (8 to 10 year-old) to the concept of computing machine, simplifies the later learning and understanding of technology-related subjects.

• C-cards mix ideas from tabletop games and puzzles, with cards acting as computational elements; computing machines can be defined, physically built and animated by disposing cards on a table, and moving objectified symbols on top of them, following formal rules.

• C-cards are designed to be easy to reify, therefore they are suitable of being implemented in very many supports, including playing cards, tiles, as well as existing toys, and software simulations.

The deck• A computational card is as a square piece of paper, with a port on each of its

four sides.

• There are 8 types of cards, and together they form the a basic deck (below):

– the peg-source card and the peg-pit card (first row),

– the cross card, the east and west turn cards and the confluence card (second row),

– then the switch and the random (last row, from left to right).

– The 4 small puppets at the far right on the first row are pegs

To create your deck, just print the 3 following pages!

(or draw the 8 card types yourself)

Rules

• To play a game at c-cards, you need to print some copies of the deck, then cut free your cards and some pegs.

• At this point you are ready to compose a card circuit, by connecting cards together

• To execute a computation, a number of pegs will be placed on the source cards of a circuit, then you will move them, one at the time, to represent the flow of information traversing the circuit

• Pegs will run through the cards following the arrows, from port to port, until they land on a pit card, where they must stop

The rules for each type of card are explained in the following pages

. . .

Source rule Pit rule

Cross rule

Switch rule2Switch rule1

Random rule

Rules explained

Note that the cross, east and west turn, and the confluence card work as pipes, for the pegs to pass through

The switch card is special: it is the only double-faced card in the deck. After cutting it, you have to fold it along the thick vertical line. Switch cards can change state dynamically:

– a switch card is placed in the circuit with its initial face upward, so that the first peg arriving from north will exit westwards; when leaving the card, the peg will force the card to flip on its other face.

– The switch card will then be flipped in its other state (face), so that a second peg arriving from north will exit eastwards. And the card will flip back to its initial face.

...

NorthWest East

South

Rules explained (cont.)

The random card is the non-deterministic version of the switch. A peg entering a random card from north, will be sent out towards east or west (with {1/2,1/2} probability distribution). To decide you will have to toss a coin: head -> the peg goes east, tail -> west.

Note that you don't need to talk about probability with the class: discussing frequency (i.e. successful attempts divided by number of trials) will be more than enough to work and understand the randomness present in the c-cards.

Moreover 8 to 10 year-old usually know about fractions, so they should be able to deal with frequencies.

NorthWest East

South

A simple example

As you can see from this example, source cards are inputs of the circuit, while pit cards are outputs.

Exercises• When designing a course based on c-cards, we propose to

consider:– at the beginning of the course show some simple static

circuits and animate them (with pegs), so to explain the behaviour of all types of cards through direct manipulation. This strategy conforms to the spiral and early bird pedagogical patterns, and represents a bottom-up phase in the learning process. In this way students can concentrate on designing and testing their own computing machines.

– After this hands-on introduction, some top-down modeling examples should be shown: a shape, i.e. the specification of a circuit’s desired behavior, is proposed to the class, and the exercise is to implement it as a card-circuit.

...

Exercises (cont.)

• Moreover, all elements employed in build these circuits are downloaded, printed and have to be cut (and folded in some cases) before use.

• So children are physically involved in the construction of their own educational tools, and if needed they can also extend it in a straightforward way, just by drawing new cards on a piece of paper.

In the following pages you will find, for each exercise:

– a textual description,

– a visual definition of the problem (a shape)

– and a possible solution

Good/Bad

(?) Can you design and build a card-circuit that behaves like this:

– when the first (good) peg comes from the source-card labelled Earth, it goes towards the pit-card labelled Paradise, then

– when the second peg (bad) comes from Earth, it goes to Hell

– and the next (that will be a good) peg, should go to Paradise, like the first, then Hell, and so on...

Good/Bad

Paradise Hell

Earth

A L

ITT

LE

HE

LP

SO

LU

TIO

N

The school-bus

My House Your HouseTheir house

meyou

twins

The school-bus

• You have to build a circuit that shows the behavior of a special school-bus.

• This bus has to bring home 4 passengers (me, you, and two twins) at their houses...

• But the passengers always come in a strange order: first me, then one of the twins, then you, and the other twin.

• Therefore the bus has to visit all the houses in the correct order

Bus

Myhouse

Your house

Theirhouse

Myhouse

Your house

Theirhouse

My House Your House

1st

Their house

2nd 4th

3rd

...

1nd 3th

A L

ITT

LE

HE

LP

SO

LU

TIO

N...

My House Your House Their house

Bus

Good OR Bad ?

Things aren't always perfect...

Sometimes a good peg can end up in hell and a bad one can reach paradise!

(?) Can you design and build a card-circuit that behaves like this:

– when a peg comes from the source-card labelled Earth, it has 1 chance out of 2 to go towards the pit-card labelled Paradise and 1 chance out of 2 to go the one labelled Hell

Good/Bad ?

? ?Paradise Hell

Earth

SO

LU

TIO

N

? ?

Not always paradise...

• Someone installed a weird computerized gate with the task of sorting people and direct them to hell or paradise.

• The gate works in this way: – each person has 1 chance out of 4 to get into hell

• Can you design and implement a circuit that emulates the new gate?

Not always Paradise!

Paradise Hell

Earth

? ?

? ?

SO

LU

TIO

N

Split #1

Split #2

3 out of 4end up here 1 out

of 4

EX

PL

AN

AT

ION

A crazy kind of bus...

• Our school-bus has a problem!

• It should work as in the previous exercise, but instead you and me sometimes get delivered at the wrong house...

• The (lucky) twins instead are brought home without any confusion.

• Can you re-design your bus-circuit to take into account the new situation?

? ?

Crazy Bus

Myhouse

Your house

Theirhouse

Myhouse

Your house

Theirhouse ?

SO

LU

TIO

N...

My House Your House Their house

Bus

The perfect coffee machine... or perhaps a candy machine

• You should now build a circuit representing a machine that sells beverages: tea and coffee

• Pressing the coffee button is represented by placing a peg in the corresponding source card (see next page)

• Each time the coffee button is pressed, the peg should end up in the pit labelled coffee delivered. The same for the tea.

• The machine should never deliver the wrong the beverage

Coffeebutton

Coffee delivered

Teabutton

Bev

erag

e M

achi

ne

Tea delivered

SO

LU

TIO

NCoffeebutton

Teabutton

Coffeedelivered

Teadelivered

But errors may occur...

• The machine is the same as in the previous exercise, but this time it does make mistakes!

• In 1 case out of 4 the customer will get the wrong beverage...

• Design a circuit that implements this machine

Note for the teacher

– this is an example of binary symmetric channels, as discussed by Shannon in his information transmission theory

– repeating the signal can improve the communication: try and suggest it to your class

Coffeebutton

Coffee delivered

Teabutton

Ran

dom

Bev

erag

e M

achi

ne

Tea delivered? ?

SO

LU

TIO

NCoffeebutton

Teabutton

Coffeedelivered

Teadelivered

A fairy tales machine

• C-cards can be used also outside Computer Science.

• In the story-telling domain, for example, a fairy tale can be constructed, bottom-up, from a set of elementary actions or situations. So from a formal language point of view, a story is more or less a string, and we can design a card circuit to act as a story-generator.

• In this exercise, students have to use random cards to define a probabilistic machine that will produce one in a set of possible stories (see the shape, next page).

• If this story-machine responds to a few inputs, students can also explore and design non-linear narrative. In the RPG community for instance, there are many examples of game-books or interactive-books, where text is decomposed into short fragments and the reader/player traverses the book depending on her choices, character parameters and score. There are usually multiple ways to navigate through the same book, which result in a different personal experience for each player.

Once there was a _____ who was riding a _________But was eaten by the ogre.

PIG BROOM

Example

pig boy princess witch prince

pig broom horse

who was riding a

Once there was a

But was eatenby the ogre.

... into the sunset!

SO

LU

TIO

N

A fairy tales machinenotes

• The solution (previous page) is not finished, but it is easy to complete it.

• The proposed way of working (by dividing a large problem in sub-problems) is typical of programming and other problem-solving activities

• Note that the probability distribution of the words pig, boy, princess, witch and prince in the first circuit can be changed by re-arranging the random cards. In the proposed solution it is:

{1/8 , 1/4 , 1/4 , 1/4 , 1/8 }

So it is twice more frequent a witch than a prince!

For more ideas...

Please check the website

c-cardsdev.sf.net

where you will find:

– a complete set of exercises for a Computer Science course, at elementary school level

– an editor/simulator (implemented in JavaScript)

– ideas for the deployment of c-cards

– ... ;)