Task Oriented Programming
in
using
Rinus Plasmeijer – Bas Lijnse - Peter Achten
Pieter Koopman - Steffen Michels - Jurriën Stutterheim
Jan Martin Jansen (NLDA) - Laszlo Domoszlai (ELTE)
LIGRETTO CASE STUDY
1
Ligretto (slightly simplified version)
•
•
•
A card game for 2 upto 4 players
Card attributes:
• numbered
(1 .. 10)
• front color
(red, green, blue, yellow)
• back color
(red, green, blue, yellow)
Each player has 40 cards: of each color all possible 10 values
2
Ligretto: initial set-up (4 players)
middle
3
10
row
1
2
ligretto
(10 cards)
hand
(concealed,
discard)
3
Ligretto: play the game
middle
3
10
row
1
2
ligretto
(10 cards)
hand
(concealed,
discard)
• only cards from row and
discard can be placed in middle
• new pile in middle starts with
card value 1
• on a middle pile only a card
with same front color and value
1 higher can be placed
• cards taken from row are
immediately replaced by top
card from ligretto pile
• flip top 3 concealed cards to
discard pile
• if concealed pile is empty,
shuffle discard pile and move
to concealed pile
• game ends as soon as first
ligretto pile is empty
4
Getting started: ligretto.dcl
:: NrOfPlayers
:: Middle
:: Pile
:: Card
:: SideUp
:: Color
:: Player
:: Row
:: Hand
:== Int
:== [Pile]
:== [Card]
= { back
:: Color
, front
:: Color
, nr
:: Int }
= Front | Back
= Red | Green | Blue | Yellow
= { color
:: Color
, row
:: Row
, ligretto
:: Pile
, hand
:: Hand }
:== [Card]
= { conceal
:: Pile
, discard
:: Pile }
5
Getting started: ligretto.dcl
nr_of_cards_in_row
colors
initial_player
row_card
move_ligretto_card_to_row
top_discard
shuffle_hand
remove_top_of_discard
swap_discards
card_matches_top_of_pile
:: NrOfPlayers
:: NrOfPlayers
:: NrOfPlayers Color Int
:: Int Player
:: Int Player
:: Player
:: Int Player
:: Player
:: Player
:: Card Pile
->
->
->
->
->
->
->
->
->
->
Int
[Color]
Player
Card
Player
Maybe Card
Player
Player
Player
Bool
6
Getting started: ligrettoTOP.icl
view_card
play_ligretto
:: SideUp Card -> HtmlTag
:: Task Color
7
© Copyright 2026 Paperzz