play : suit -> briscola -> briscola scola -> string * int - 15 parameters (trumpsuit, playerlcard, player demonstrates one round of briscola play. G hich player 1 and 3 are Team1, player 2 and

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In OCaml Programming Language:

Create a function play
val play : suit -> briscola -> briscola -> briscola ->
briscola -> string * int =<fun>
with 5 parameters (trumpsuit, playerlcard, player2card, player3card, player4card),
that demonstrates one round of briscola play. Game is played by four players,
of which player 1 and 3 are Teaml, player 2 and 4 are Team2. If a trump card is
Transcribed Image Text:Create a function play val play : suit -> briscola -> briscola -> briscola -> briscola -> string * int =<fun> with 5 parameters (trumpsuit, playerlcard, player2card, player3card, player4card), that demonstrates one round of briscola play. Game is played by four players, of which player 1 and 3 are Teaml, player 2 and 4 are Team2. If a trump card is
played, then the highest trump card wins the round. If no trump card is played
then the highest card among the same suit as the playerlcard wins. The func-
tion returns which team won (Teaml or Team2) as well as the number of points
scored. The points scored in a round is the sum of the points of the individual
cards played. You can assume all four played cards are pairwise different.
Example:
# play Cup (Number (4,Club)) (Rider Club) (Number (7,Coin)) (Number (1, Cup));;
# (*4th card is best card because trump*)
- : string * int = ("Team2", 14)
# play Sword (Number (4,Club)) (Number (3,Club)) (Number (7,Coin)) (Number (1, Cup));;
# (*2nd card is best, because it is highest in 1st card's suit and there are no trumps *)
- : string * int = ("Team2", 21)
# play Sword (Number (4,Club)) (Number (7,Coin)) (Rider Club) (Number (1, Cup));;
# (*3rd card is best*)
- : string * int = ("Team1", 14)
# play Club (Number (2,Coin)) (Number (4,Club)) (Jack Club) (Number (6, Cup)); ;
# (*3rd card is best, because it is highest among trumps*)
- : string * int = ("Team1", 2)
Transcribed Image Text:played, then the highest trump card wins the round. If no trump card is played then the highest card among the same suit as the playerlcard wins. The func- tion returns which team won (Teaml or Team2) as well as the number of points scored. The points scored in a round is the sum of the points of the individual cards played. You can assume all four played cards are pairwise different. Example: # play Cup (Number (4,Club)) (Rider Club) (Number (7,Coin)) (Number (1, Cup));; # (*4th card is best card because trump*) - : string * int = ("Team2", 14) # play Sword (Number (4,Club)) (Number (3,Club)) (Number (7,Coin)) (Number (1, Cup));; # (*2nd card is best, because it is highest in 1st card's suit and there are no trumps *) - : string * int = ("Team2", 21) # play Sword (Number (4,Club)) (Number (7,Coin)) (Rider Club) (Number (1, Cup));; # (*3rd card is best*) - : string * int = ("Team1", 14) # play Club (Number (2,Coin)) (Number (4,Club)) (Jack Club) (Number (6, Cup)); ; # (*3rd card is best, because it is highest among trumps*) - : string * int = ("Team1", 2)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Storage Devices
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education