WeixiangYan/CodeTransOcean huggingface dataset:
Task: Temperature conversion






PHP: while (true) {
    echo "\nEnter a value in kelvin (q to quit): ";
    if ($kelvin = trim(fgets(STDIN))) {
        if ($kelvin == 'q') {
            echo 'quitting';
            break;
        }
        if (is_numeric($kelvin)) {
            $kelvin = floatVal($kelvin);
            if ($kelvin >= 0) {
                printf(" K  %2.2f\n", $kelvin);
                printf(" C  %2.2f\n", $kelvin - 273.15);
                printf(" F  %2.2f\n", $kelvin * 1.8 - 459.67);
                printf(" R  %2.2f\n", $kelvin * 1.8);
            } else printf(" %2.2f K is below absolute zero\n", $kelvin);
        }
    }
}




COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. temp-conversion.
       
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       78  Kelvin-Rankine-Ratio    VALUE 0.5556. 
       78  Kelvin-Celsius-Diff     VALUE 273.15.
       78  Rankine-Fahrenheit-Diff VALUE 459.67.
       
       01  temp-kelvin             PIC S9(8)V99.
       01  temp-rankine            PIC S9(8)V99.
       
       01  kelvin                  PIC -(7)9.99.
       01  celsius                 PIC -(7)9.99.
       01  rankine                 PIC -(7)9.99.
       01  fahrenheit              PIC -(7)9.99.
       
       PROCEDURE DIVISION.
           DISPLAY "Enter a temperature in Kelvin to convert: " NO ADVANCING
           ACCEPT temp-kelvin
       
           MOVE temp-kelvin TO kelvin
           DISPLAY "K " kelvin
           
           SUBTRACT Kelvin-Celsius-Diff FROM temp-kelvin GIVING celsius
           DISPLAY "C " celsius
           
           DIVIDE temp-kelvin BY Kelvin-Rankine-Ratio
               GIVING temp-rankine, rankine
           SUBTRACT Rankine-Fahrenheit-Diff FROM temp-rankine GIVING fahrenheit
           
           DISPLAY "F " fahrenheit
           DISPLAY "R " rankine
       
           GOBACK
           .
Task: Pig the dice game

C: #include <stdio.h>
#include <stdlib.h>
#include <time.h>


const int NUM_PLAYERS = 2;
const int MAX_POINTS = 100;



int randrange(int min, int max){
    return (rand() % (max - min + 1)) + min;
}



void ResetScores(int *scores){
    for(int i = 0; i < NUM_PLAYERS; i++){
        scores[i] = 0;
    }
}


void Play(int *scores){
    int scoredPoints = 0;
    int diceResult;
    int choice;

    for(int i = 0; i < NUM_PLAYERS; i++){
        while(1){
            printf("Player %d - You have %d total points and %d points this turn \nWhat do you want to do (1)roll or (2)hold: ", i + 1, scores[i], scoredPoints);
            scanf("%d", &choice);

            if(choice == 1){
                diceResult = randrange(1, 6);
                printf("\nYou rolled a %d\n", diceResult);

                if(diceResult != 1){
                    scoredPoints += diceResult;
                }
                else{
                    printf("You loose all your points from this turn\n\n");
                    scoredPoints = 0;
                    break;
                }
            }
            else if(choice == 2){
                scores[i] += scoredPoints;
                printf("\nYou holded, you have %d points\n\n", scores[i]);

                break;
            }
        }

        scoredPoints = 0;
        CheckForWin(scores[i], i + 1);

    }
}


void CheckForWin(int playerScore, int playerNum){
    if(playerScore >= MAX_POINTS){
        printf("\n\nCONGRATULATIONS PLAYER %d, YOU WIN\n\n!", playerNum);

        exit(EXIT_SUCCESS);
    }
}


int main()
{
    srand(time(0));

    int scores[NUM_PLAYERS];
    ResetScores(scores);

    while(1){
        Play(scores);
    }

    return 0;
}











Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;
Task: Pig the dice game




Go: package main

import (
	"fmt"
	"math/rand"
	"strings"
	"time"
)

func main() {
	rand.Seed(time.Now().UnixNano()) 

	playerScores := [...]int{0, 0}
	turn := 0
	currentScore := 0

	for {
		player := turn % len(playerScores)

		fmt.Printf("Player %v [%v, %v], (H)old, (R)oll or (Q)uit: ", player,
			playerScores[player], currentScore)

		var answer string
		fmt.Scanf("%v", &answer)
		switch strings.ToLower(answer) {
		case "h": 
			playerScores[player] += currentScore
			fmt.Printf("    Player %v now has a score of %v.\n\n", player, playerScores[player])

			if playerScores[player] >= 100 {
				fmt.Printf("    Player %v wins!!!\n", player)
				return
			}

			currentScore = 0
			turn += 1
		case "r": 
			roll := rand.Intn(6) + 1

			if roll == 1 {
				fmt.Printf("    Rolled a 1. Bust!\n\n")
				currentScore = 0
				turn += 1
			} else {
				fmt.Printf("    Rolled a %v.\n", roll)
				currentScore += roll
			}
		case "q": 
			return
		default: 
			fmt.Print("  Please enter one of the given inputs.\n")
		}
	}
	fmt.Printf("Player %v wins!!!\n", (turn-1)%len(playerScores))
}








Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;
Task: Pig the dice game





Java: import java.util.*;

public class PigDice {

    public static void main(String[] args) {
        final int maxScore = 100;
        final int playerCount = 2;
        final String[] yesses = {"y", "Y", ""};

        int[] safeScore = new int[2];
        int player = 0, score = 0;

        Scanner sc = new Scanner(System.in);
        Random rnd = new Random();

        while (true) {
            System.out.printf(" Player %d: (%d, %d) Rolling? (y/n) ", player,
                    safeScore[player], score);
            if (safeScore[player] + score < maxScore
                    && Arrays.asList(yesses).contains(sc.nextLine())) {
                final int rolled = rnd.nextInt(6) + 1;
                System.out.printf(" Rolled %d\n", rolled);
                if (rolled == 1) {
                    System.out.printf(" Bust! You lose %d but keep %d\n\n",
                            score, safeScore[player]);
                } else {
                    score += rolled;
                    continue;
                }
            } else {
                safeScore[player] += score;
                if (safeScore[player] >= maxScore)
                    break;
                System.out.printf(" Sticking with %d\n\n", safeScore[player]);
            }
            score = 0;
            player = (player + 1) % playerCount;
        }
        System.out.printf("\n\nPlayer %d wins with a score of %d",
                player, safeScore[player]);
    }
}







Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;
Task: Pig the dice game







Python: 



from random import randint

playercount = 2
maxscore = 100
safescore = [0] * playercount
player = 0
score=0

while max(safescore) < maxscore:
    rolling = input("Player %i: (%i, %i) Rolling? (Y) "
                    % (player, safescore[player], score)).strip().lower() in {'yes', 'y', ''}
    if rolling:
        rolled = randint(1, 6)
        print('  Rolled %i' % rolled)
        if rolled == 1:
            print('  Bust! you lose %i but still keep your previous %i'
                  % (score, safescore[player]))
            score, player = 0, (player + 1) % playercount
        else:
            score += rolled
    else:
        safescore[player] += score
        if safescore[player] >= maxscore:
            break
        print('  Sticking with %i' % safescore[player])
        score, player = 0, (player + 1) % playercount
        
print('\nPlayer %i wins with a score of %i' %(player, safescore[player]))





Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;
Task: Pig the dice game








VB: Option Explicit

Sub Main_Pig()
Dim Scs() As Byte, Ask As Integer, Np As Boolean, Go As Boolean
Dim Cp As Byte, Rd As Byte, NbP As Byte, ScBT As Byte
    
    Const INPTXT As String = "Enter number of players : "
    Const INPTITL As String = "Numeric only"
    Const ROL As String = "Player ¤¤¤¤ rolls the die."
    Const MSG As String = "Do you want to ""hold"" : "
    Const TITL As String = "Total if you keep : "
    Const RES As String = "The die give you : ¤¤¤¤ points."
    Const ONE As String = "The die give you : 1 point. Sorry!" & vbCrLf & "Next player."
    Const WIN As String = "Player ¤¤¤¤ win the Pig Dice Game!"
    Const STW As Byte = 100

    Randomize Timer
    NbP = Application.InputBox(INPTXT, INPTITL, 2, Type:=1)
    ReDim Scs(1 To NbP)
    Cp = 1
    Do
        ScBT = 0
        Do
            MsgBox Replace(ROL, "¤¤¤¤", Cp)
            Rd = Int((Rnd * 6) + 1)
            If Rd > 1 Then
                MsgBox Replace(RES, "¤¤¤¤", Rd)
                ScBT = ScBT + Rd
                If Scs(Cp) + ScBT >= STW Then
                    Go = True
                    Exit Do
                End If
                Ask = MsgBox(MSG & ScBT, vbYesNo, TITL & Scs(Cp) + ScBT)
                If Ask = vbYes Then
                    Scs(Cp) = Scs(Cp) + ScBT
                    Np = True
                End If
            Else
                MsgBox ONE
                Np = True
            End If
        Loop Until Np
        If Not Go Then
            Np = False
            Cp = Cp + 1
            If Cp > NbP Then Cp = 1
        End If
    Loop Until Go
    MsgBox Replace(WIN, "¤¤¤¤", Cp)
End Sub




Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;
Task: Pig the dice game

C: #include <stdio.h>
#include <stdlib.h>
#include <time.h>


const int NUM_PLAYERS = 2;
const int MAX_POINTS = 100;



int randrange(int min, int max){
    return (rand() % (max - min + 1)) + min;
}



void ResetScores(int *scores){
    for(int i = 0; i < NUM_PLAYERS; i++){
        scores[i] = 0;
    }
}


void Play(int *scores){
    int scoredPoints = 0;
    int diceResult;
    int choice;

    for(int i = 0; i < NUM_PLAYERS; i++){
        while(1){
            printf("Player %d - You have %d total points and %d points this turn \nWhat do you want to do (1)roll or (2)hold: ", i + 1, scores[i], scoredPoints);
            scanf("%d", &choice);

            if(choice == 1){
                diceResult = randrange(1, 6);
                printf("\nYou rolled a %d\n", diceResult);

                if(diceResult != 1){
                    scoredPoints += diceResult;
                }
                else{
                    printf("You loose all your points from this turn\n\n");
                    scoredPoints = 0;
                    break;
                }
            }
            else if(choice == 2){
                scores[i] += scoredPoints;
                printf("\nYou holded, you have %d points\n\n", scores[i]);

                break;
            }
        }

        scoredPoints = 0;
        CheckForWin(scores[i], i + 1);

    }
}


void CheckForWin(int playerScore, int playerNum){
    if(playerScore >= MAX_POINTS){
        printf("\n\nCONGRATULATIONS PLAYER %d, YOU WIN\n\n!", playerNum);

        exit(EXIT_SUCCESS);
    }
}


int main()
{
    srand(time(0));

    int scores[NUM_PLAYERS];
    ResetScores(scores);

    while(1){
        Play(scores);
    }

    return 0;
}
Task: Pig the dice game


C++: #include <windows.h>
#include <iostream>
#include <string>


using namespace std;


const int PLAYERS = 2, MAX_POINTS = 100;


class player
{
public:
    player() { reset(); }
    void reset()
    {
	name = "";
	current_score = round_score = 0;
    }
    string getName()             { return name; }
    void setName( string n )     { name = n; }
    int getCurrScore()           { return current_score; }
    void addCurrScore()          { current_score += round_score; }
    int getRoundScore()          { return round_score; }
    void addRoundScore( int rs ) { round_score += rs; }
    void zeroRoundScore()        { round_score = 0; }

private:
    string name;
    int current_score, round_score;
};

class pigGame
{
public:
    pigGame() { resetPlayers(); }

    void play()
    {
	while( true )
	{
	    system( "cls" );
	    int p = 0;
	    while( true )
	    {
		if( turn( p ) )
		{
		    praise( p );
		    break;
		}

		++p %= PLAYERS;
	    }

	    string r;
	    cout << "Do you want to play again ( y / n )? "; cin >> r;
	    if( r != "Y" && r != "y" ) return;
	    resetPlayers();
	}
    }

private:
    void resetPlayers()
    {
	system( "cls" );
	string n;
	for( int p = 0; p < PLAYERS; p++ )
	{
	    _players[p].reset();
	    cout << "Enter name player " << p + 1 << ": "; cin >> n;
	    _players[p].setName( n );
	}

    }

    void praise( int p )
    {
	system( "cls" );
	cout << "CONGRATULATIONS " << _players[p].getName() << ", you are the winner!" << endl << endl;
	cout << "Final Score" << endl;
	drawScoreboard();
	cout << endl << endl;
    }

    void drawScoreboard()
    {
	for( int p = 0; p < PLAYERS; p++ )
	    cout << _players[p].getName() << ": " << _players[p].getCurrScore() << " points" << endl;
	cout << endl;
    }

    bool turn( int p )
    {
	system( "cls" );
	drawScoreboard();
	_players[p].zeroRoundScore();
	string r;
	int die;
	while( true )
	{
	    cout << _players[p].getName() << ", your round score is: " << _players[p].getRoundScore() << endl;
	    cout << "What do you want to do (H)old or (R)oll? "; cin >> r;
	    if( r == "h" || r == "H" )
	    {
		_players[p].addCurrScore();
		return _players[p].getCurrScore() >= MAX_POINTS;
	    }
	    if( r == "r" || r == "R" )
	    {
		die = rand() % 6 + 1;
		if( die == 1 )
		{
	    	    cout << _players[p].getName() << ", your turn is over." << endl << endl;
		    system( "pause" );
		    return false;
		}
		_players[p].addRoundScore( die );
	    }
	    cout << endl;
	}
	return false;
    }

    player	_players[PLAYERS];
};

int main( int argc, char* argv[] )
{
    srand( GetTickCount() );
    pigGame pg;
    pg.play();
    return 0;
}
Task: Pig the dice game





Java: import java.util.*;

public class PigDice {

    public static void main(String[] args) {
        final int maxScore = 100;
        final int playerCount = 2;
        final String[] yesses = {"y", "Y", ""};

        int[] safeScore = new int[2];
        int player = 0, score = 0;

        Scanner sc = new Scanner(System.in);
        Random rnd = new Random();

        while (true) {
            System.out.printf(" Player %d: (%d, %d) Rolling? (y/n) ", player,
                    safeScore[player], score);
            if (safeScore[player] + score < maxScore
                    && Arrays.asList(yesses).contains(sc.nextLine())) {
                final int rolled = rnd.nextInt(6) + 1;
                System.out.printf(" Rolled %d\n", rolled);
                if (rolled == 1) {
                    System.out.printf(" Bust! You lose %d but keep %d\n\n",
                            score, safeScore[player]);
                } else {
                    score += rolled;
                    continue;
                }
            } else {
                safeScore[player] += score;
                if (safeScore[player] >= maxScore)
                    break;
                System.out.printf(" Sticking with %d\n\n", safeScore[player]);
            }
            score = 0;
            player = (player + 1) % playerCount;
        }
        System.out.printf("\n\nPlayer %d wins with a score of %d",
                player, safeScore[player]);
    }
}
Task: Pig the dice game







Python: 



from random import randint

playercount = 2
maxscore = 100
safescore = [0] * playercount
player = 0
score=0

while max(safescore) < maxscore:
    rolling = input("Player %i: (%i, %i) Rolling? (Y) "
                    % (player, safescore[player], score)).strip().lower() in {'yes', 'y', ''}
    if rolling:
        rolled = randint(1, 6)
        print('  Rolled %i' % rolled)
        if rolled == 1:
            print('  Bust! you lose %i but still keep your previous %i'
                  % (score, safescore[player]))
            score, player = 0, (player + 1) % playercount
        else:
            score += rolled
    else:
        safescore[player] += score
        if safescore[player] >= maxscore:
            break
        print('  Sticking with %i' % safescore[player])
        score, player = 0, (player + 1) % playercount
        
print('\nPlayer %i wins with a score of %i' %(player, safescore[player]))
Task: Pig the dice game








VB: Option Explicit

Sub Main_Pig()
Dim Scs() As Byte, Ask As Integer, Np As Boolean, Go As Boolean
Dim Cp As Byte, Rd As Byte, NbP As Byte, ScBT As Byte
    
    Const INPTXT As String = "Enter number of players : "
    Const INPTITL As String = "Numeric only"
    Const ROL As String = "Player ¤¤¤¤ rolls the die."
    Const MSG As String = "Do you want to ""hold"" : "
    Const TITL As String = "Total if you keep : "
    Const RES As String = "The die give you : ¤¤¤¤ points."
    Const ONE As String = "The die give you : 1 point. Sorry!" & vbCrLf & "Next player."
    Const WIN As String = "Player ¤¤¤¤ win the Pig Dice Game!"
    Const STW As Byte = 100

    Randomize Timer
    NbP = Application.InputBox(INPTXT, INPTITL, 2, Type:=1)
    ReDim Scs(1 To NbP)
    Cp = 1
    Do
        ScBT = 0
        Do
            MsgBox Replace(ROL, "¤¤¤¤", Cp)
            Rd = Int((Rnd * 6) + 1)
            If Rd > 1 Then
                MsgBox Replace(RES, "¤¤¤¤", Rd)
                ScBT = ScBT + Rd
                If Scs(Cp) + ScBT >= STW Then
                    Go = True
                    Exit Do
                End If
                Ask = MsgBox(MSG & ScBT, vbYesNo, TITL & Scs(Cp) + ScBT)
                If Ask = vbYes Then
                    Scs(Cp) = Scs(Cp) + ScBT
                    Np = True
                End If
            Else
                MsgBox ONE
                Np = True
            End If
        Loop Until Np
        If Not Go Then
            Np = False
            Cp = Cp + 1
            If Cp > NbP Then Cp = 1
        End If
    Loop Until Go
    MsgBox Replace(WIN, "¤¤¤¤", Cp)
End Sub
Task: Pig the dice game




Go: package main

import (
	"fmt"
	"math/rand"
	"strings"
	"time"
)

func main() {
	rand.Seed(time.Now().UnixNano()) 

	playerScores := [...]int{0, 0}
	turn := 0
	currentScore := 0

	for {
		player := turn % len(playerScores)

		fmt.Printf("Player %v [%v, %v], (H)old, (R)oll or (Q)uit: ", player,
			playerScores[player], currentScore)

		var answer string
		fmt.Scanf("%v", &answer)
		switch strings.ToLower(answer) {
		case "h": 
			playerScores[player] += currentScore
			fmt.Printf("    Player %v now has a score of %v.\n\n", player, playerScores[player])

			if playerScores[player] >= 100 {
				fmt.Printf("    Player %v wins!!!\n", player)
				return
			}

			currentScore = 0
			turn += 1
		case "r": 
			roll := rand.Intn(6) + 1

			if roll == 1 {
				fmt.Printf("    Rolled a 1. Bust!\n\n")
				currentScore = 0
				turn += 1
			} else {
				fmt.Printf("    Rolled a %v.\n", roll)
				currentScore += roll
			}
		case "q": 
			return
		default: 
			fmt.Print("  Please enter one of the given inputs.\n")
		}
	}
	fmt.Printf("Player %v wins!!!\n", (turn-1)%len(playerScores))
}
Task: Pig the dice game






PHP: error_reporting(E_ALL & ~ ( E_NOTICE | E_WARNING ));

define('MAXSCORE', 100);
define('PLAYERCOUNT', 2);

$confirm = array('Y', 'y', '');

while (true) {
    printf(' Player %d: (%d, %d) Rolling? (Yn) ', $player,
            $safeScore[$player], $score);
    if ($safeScore[$player] + $score < MAXSCORE &&
            in_array(trim(fgets(STDIN)), $confirm)) {
        $rolled = rand(1, 6);
        echo " Rolled $rolled \n";
        if ($rolled == 1) {
            printf(' Bust! You lose %d but keep %d \n\n',
                    $score, $safeScore[$player]);
        } else {
            $score += $rolled;
            continue;
        }
    } else {
        $safeScore[$player] += $score;
        if ($safeScore[$player] >= MAXSCORE)
            break;
        echo ' Sticking with ', $safeScore[$player], '\n\n';
    }
    $score = 0;
    $player = ($player + 1) % PLAYERCOUNT;
}
printf('\n\nPlayer %d wins with a score of %d ',
    $player, $safeScore[$player]);
Task: Pig the dice game






PHP: error_reporting(E_ALL & ~ ( E_NOTICE | E_WARNING ));

define('MAXSCORE', 100);
define('PLAYERCOUNT', 2);

$confirm = array('Y', 'y', '');

while (true) {
    printf(' Player %d: (%d, %d) Rolling? (Yn) ', $player,
            $safeScore[$player], $score);
    if ($safeScore[$player] + $score < MAXSCORE &&
            in_array(trim(fgets(STDIN)), $confirm)) {
        $rolled = rand(1, 6);
        echo " Rolled $rolled \n";
        if ($rolled == 1) {
            printf(' Bust! You lose %d but keep %d \n\n',
                    $score, $safeScore[$player]);
        } else {
            $score += $rolled;
            continue;
        }
    } else {
        $safeScore[$player] += $score;
        if ($safeScore[$player] >= MAXSCORE)
            break;
        echo ' Sticking with ', $safeScore[$player], '\n\n';
    }
    $score = 0;
    $player = ($player + 1) % PLAYERCOUNT;
}
printf('\n\nPlayer %d wins with a score of %d ',
    $player, $safeScore[$player]);






Ada: package Pig is
   
   type Dice_Score is range 1 .. 6;
   
   type Player is tagged private; 
   function Recent(P: Player) return Natural;
   function All_Recent(P: Player) return Natural;
   function Score(P: Player) return Natural;
   
   type Actor is abstract tagged null record;
   function Roll_More(A: Actor; Self, Opponent: Player'Class) 
		     return Boolean is abstract;
   
   procedure Play(First, Second: Actor'Class; First_Wins: out Boolean);
   
private
   type Player is tagged record
      Score: Natural := 0;
      All_Recent: Natural := 0;
      Recent_Roll: Dice_Score := 1;
   end record;

end Pig;