TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: BENJAMIN L MCGEE
date: 1997-05-22 09:39:00
subject: First C++ prog 2/3

'>>> Page 2 of SLOT.CPP begins here. 
    cout << '\n'; 
    cout top top top <<_
' '\n'; 
    cout mid mid mid <<_ 
' '\n'; 
    cout bot bot bot <<_ 
' '\n'; 
 
} 
 
 
 
int SlotMachine::Win(){ 
 
    Jackpot = 0; 
 
    if ( (Left->top == Middle->top) && (Left->top == Right->top) ) 
        Jackpot = Jackpot + Left->top; 
 
    if ( (Left->mid == Middle->mid) && (Left->mid == Right->mid) ) 
        Jackpot = Jackpot + Left->mid; 
 
    if ( (Left->bot == Middle->bot) && (Left->bot == Right->bot) ) 
        Jackpot = Jackpot + Left->bot; 
 
    if ( (Left->top == Middle->mid) && (Left->top == Right->bot) ) 
        Jackpot = Jackpot + Left->top; 
 
    if ( (Left->bot == Middle->mid) && (Left->bot == Right->top) ) 
        Jackpot = Jackpot + Left->bot; 
 
    return (Jackpot); 
} 
 
 
 
void Wheel::Spin(){ 
 
    int m, 
        t, 
        b; 
 
    m = rand() % WHEEL_MAX + 1; 
    t = m - 1; 
    b = m + 1; 
    if (t < 1) t = WHEEL_MAX; 
    if (b > WHEEL_MAX) b = 1; 
 
    top = t; 
    mid = m; 
    bot = b; 
} 
 
 
 
Player::Player(){ 
 
    Cash = STARTING_CASH; 
    cout << "To whom shall we send the bill?"; 
    cin.getline(Name, 14); 
 
} 
 
 
 
int Player::SpinAgain(){ 
    char Answer; 
    cout << "Spin again " << Name << "?"; 
    cin >> Answer; 
    cin.ignore(80, '\n'); 
 
    if ( (Answer == 'y') || (Answer == 'Y') ) 
        return(1); 
    else 
        return(0); 
 
} 
 
 
 
void Player::Pay(int Amount){ 
 
    Cash = Cash - Amount; 
'>>> Page 2 of SLOT.CPP ends here. Continued on next page. 
  
 
*Welcome to the Future!  It's just starting now ... 
  
blm
--- FLAME v1.1
---------------
* Origin: Purgatoire BBS, 719-846-0140, Trinidad, CO, V.34 (1:15/7)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.