1 / 7

T ask O riented P rogramming i n using Rinus Plasmeijer – Bas Lijnse - Peter Achten

T ask O riented P rogramming i n using Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurriën Stutterheim Jan Martin Jansen (NLDA) - Laszlo Domoszlai (ELTE) LIGRETTO CASE STUDY. Ligretto (slightly simplified version).

blythe
Télécharger la présentation

T ask O riented P rogramming i n using Rinus Plasmeijer – Bas Lijnse - Peter Achten

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Task Oriented Programming in using Rinus Plasmeijer–Bas Lijnse- Peter Achten Pieter Koopman- Steffen Michels-JurriënStutterheim Jan Martin Jansen (NLDA) - Laszlo Domoszlai (ELTE) LIGRETTO CASE STUDY

  2. 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

  3. Ligretto: initial set-up (4 players) middle 2 - 10 1 3 hand (concealed, discard) ligretto (10 cards) row

  4. Ligretto: play the game middle • 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 2 - 10 1 3 hand (concealed, discard) ligretto (10 cards) row

  5. Getting started: ligretto.dcl • :: NrOfPlayers :== Int • :: Middle :== [Pile] • :: Pile :== [Card] • :: Card = { back :: Color • , front :: Color • , nr :: Int } • :: SideUp = Front | Back • :: Color = Red | Green | Blue | Yellow • :: Player = { color :: Color • , row :: Row • , ligretto :: Pile • , hand :: Hand } • :: Row :== [Card] • :: Hand = { conceal :: Pile • , discard :: Pile }

  6. Getting started: ligretto.dcl • nr_of_cards_in_row :: NrOfPlayers -> Int • colors :: NrOfPlayers -> [Color] • initial_player :: NrOfPlayers Color Int -> Player • row_card :: Int Player -> Card • move_ligretto_card_to_row :: Int Player -> Player • top_discard :: Player -> Maybe Card • shuffle_hand :: Int Player -> Player • remove_top_of_discard :: Player -> Player • swap_discards :: Player -> Player • card_matches_top_of_pile :: Card Pile -> Bool

  7. Getting started: ligrettoTOP.icl • view_card :: SideUp Card -> HtmlTag • play_ligretto :: Task Color

More Related