peconia / slot_machine.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
import random , time |
def reel (): |
return random . choice ( ‘7♣♣♠♠♠♦♦♦♥♥♥♥’ ) |
def print_row ( first , second , third ): |
print ( ‘[ <> | <> | <> ]’ . format ( first , second , third , t = time . sleep ( .15 )), end = ‘ \r ‘ ) |
def round (): |
for i in range ( 30 ): |
if i < 12 : |
first = reel () |
second = reel () |
third = reel () |
print_row ( first , second , third ) |
elif i < 25 : |
first = first |
second = reel () |
third = reel () |
print_row ( first , second , third ) |
else : |
first = first |
second = second |
third = reel () |
print_row ( first , second , third ) |
return ( first , second , third ) |
def ask_to_play (): |
global stake |
while ( True ): |
answer = input ( “You have £” + str ( stake ) + “. Would you like to play? y/n ” ) |
answer = answer . lower (). strip () |
if ( answer == “y” ): |
return True |
elif ( answer == “n” ): |
print ( “You ended the game with £” + str ( stake ) + ” in your hand.” ) |
return False |
else : |
print ( “incorrect input – type either y or n” ) |
def check_win ( a , b , c ): |
global stake |
if a == 7 and b == 7 and c == 7 : |
winnings = 250 |
elif a == 7 and b == 7 and ( c == “♣” or c == “♠” ): |
winnings = 100 |
elif a == “♣” and b == “♣” and ( c == 7 or c == “♣” ): |
winnings = 40 |
elif a == “♠” and b == “♠” and ( c == 7 or c == “♠” ): |
winnings = 20 |
elif a == “♦” and b == “♦” and c == “♦” : |
winnings = 15 |
elif a == “♦” and b == “♦” : |
winnings = 5 |
elif a == “♥” and b == “♥” and c == “♥” : |
winnings = 3 |
elif a == “♥” and b == “♥” : |
winnings = 2 |
else : |
winnings = 0 |
if winnings > 0 : |
stake += winnings |
print ( “Congratulations! You just won £” + str ( winnings ) + “. ” ) |
else : |
print ( “Sorry, no win this time.” ) |
def play (): |
global stake |
want_to_play = ask_to_play () |
while ( stake >= 1 and want_to_play == True ): |
stake -= 1 ; |
round1 = round () |
a , b , c = round1 |
print ( ‘[ <> | <> | <> ]’ . format ( a , b , c )) |
check_win ( a , b , c ) |
if stake == 0 : |
print ( “Sorry mate, you ran out of money!” ) |
break ; |
want_to_play = ask_to_play () |
print ( ”’Welcome to play the Slot Machine! |
You’ll start with £20. You can choose to quit |
and cash out after each round. Each round costs £1. |
To win you must get one of the following combinations: |
7 \t 7 \t 7 \t pays \t £250 |
7 \t 7 \t ♣ / ♠ \t pays \t £100 |
♣ \t ♣ \t ♣ / 7 \t pays \t £40 |
♠ \t ♠ \t ♠ / 7 \t pays \t £20 |
♦ \t ♦ \t ♦ \t pays \t £15 |
♦ \t ♦ \t – \t pays \t £5 |
♥ \t ♥ \t ♥ \t pays \t £3 |
♥ \t ♥ \t – \t pays \t £2 |
”’ ) |
stake = 20 |
play () |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
geopsy.org
I do not understand the SLOT option in command line interface.
What is the meaning of the slot number in the the following commands:
1) geopsy -db databasename -tool geopsyhv -slot 1 -group groupname
2) geopsy -db databasename -tool geopsyarray -slot 0 -group groupname
In fact I would like to compute High Resolution FK analysis (capon), which value of slot should I select?
admin Site Admin Posts: 749 Joined: Mon Aug 13, 2007 11:48 am Location: ISTerre Contact:
Post by admin » Wed Dec 05, 2007 12:52 pm
Option -h without argument just gives you general information.
Generic options: -help Show help about options. SECTION may be empty or: all, examples, fk, generic, geopsy, hrfk, hv, hvrotate, hvtfa, linearfkactive, linearfkpassive, mspac, qt, spectrum, spectrum, structure
You can get specific help on various topics by adding an argument to option -h.
$ geopsy -h fk FK (tag=geopsyarray, slot=0) options: -param Set processing parameters as specified in FILE.log -export-grids Export all FK grids for all frequency bands and time windows to files fkgrid_fxxx_twxxx (be careful, need a lot of disk space) $ geopsy -h hrfk High resolution FK (tag=geopsyarray, slot=1) options: -param Set processing parameters as specified in FILE.log
In fact, a tool plugin may contain more than one slot (for geopsyarray: fk, hrfk, linearfkactive, linearfkpassive) that correspond each to an icon in the toolbar (or menu “tools”).
To start geopsy for high resolution FK:
geopsy -db /home/mwathele/M2/database.gpy -tool geopsyarray -slot 1 -group "333 sources/Central station" -param param.log
param.log must contain a section with parameters as saved by the high resolution toolbox (after pressing ‘Start’).[/code]
Kueri lain yang serupa dengan CMD368.net Mobile yang dicari:
- Aplikasi CMD368
- CMD368 Desktop
- CMD368 Apk
- CMDbet Accounts In Singapore
- Agen CMDbet Casino
- CMD368 Alternative Blok
cmd368
Alternative Hanoi, VN . more
cmd368
Alternative Hanoi, VN
cmd368
Alternative Hanoi, VN . more
cmd368
Alternative Hanoi, VN
Saved. Receive Updates?
ReverbNation
Artist Membership
Artist Development
- Opportunity Submissions
- Crowd Reviews
- Gig Finder
Artist Tools
- Advertise on Music Sites
- Sponsored Artists
- Digital Distribution
- Sell Direct
- Fan Reach
- Site Builder
- Marketplace
- Publishing Administration
Policies
ReverbNation
Artist Membership
Artist Development
- Opportunity Submissions
- Crowd Reviews
- Gig Finder
Artist Tools
- Advertise on Music Sites
- Sponsored Artists
- Digital Distribution
- Sell Direct
- Fan Reach
- Site Builder
- Marketplace
- Publishing Administration
Policies
© 2006-2024 BandLab Singapore Pte. Ltd.
All third party trademarks are the property of the respective trademark owners. ReverbNation is not affiliated with those trademark owners.