Sunteți pe pagina 1din 1

WORDGUESSI

NGGAME

I
NTRODUCTI
ON:

Int
hisgame,therei
sali
stofwordspresent
,outofwhichouri
nter
pret
erwil
lchoose1
random wor
d.Theuserfir
sthast
oinputt
heirnamesandt hen,
wil
lbeaskedtoguessany
alphabet
.

Wor
dgames( al
socall
edwordgamepuzzl
es)arespokenorboar
dgamesof
ten
desi
gnedtot
estabi
l
itywit
hlanguageort
oexpl
orei
tsproper
ti
es.

Wordgamesaregener al
lyusedasasourceofentert
ainment
,butcanaddit
ional
ly
ser
veaneducat i
onal
purpose.Youngchildr
encanenjoyplayi
nggamessuchasHangman, whil
e
nat
ural
lydevel
opingi
mpor t
antlanguageskil
lsl
i
kespell
ing.Resear
cher
shavefoundthatadult
s
whoregular
lysol
vedcrosswordpuzzles,whi
chrequi
refamil
iari
tywi
thalar
gervocabular
y,had
bet
terbrai
nfuncti
onlat
erinli
fe.

Word-basedgameshowshav ebeenapartoftel
evi
sionandr
adi
othr
oughout
broadcasthi
story,i
ncl
udingSpel
li
ngBee(t
hefi
rstt
elevi
sedgameshow)andWheelofFor
tune
(t
helongest-
runningsyndicat
edgameshowintheUnit
edStates).

I
nwor
dguessi
nggame,
weuseamodul
enameasRandom modul
e

RANDOM MODULE:

Someti
meswewantt hecomput ertopickarandom numberinagi venrange,picka
random el
ementfr
om alist
,pickarandom cardfrom adeck,fl
i
pacoi n,etc.Therandom
modul epr
ovi
desaccesstofuncti
onst hatsuppor
tthesetypesofoperati
ons.Onesuch
operati
onisr
andom.choi
ce()method( ret
urnsarandom it
em from ali
st,t
uple,orstr
ing.
)that
wear egoi
ngtouseinordertoselectonerandom wordfrom alistofwordsthatwe’vecreated.

Inwor
dguessinggame, Theuserfi
rsthastoinputthei
rnamesandt hen,wi
ll
be
askedtoguessanyal
phabet.I
ftherandom wordcontai
nst hatal
phabet
,itwi
llbeshownast he
output
(wi
thcorr
ectpl
acement)elsethepr
ogram wil
lasky outoguessanotheral
phabet.User
wil
lbegiven12tur
ns(
canbechangedaccor di
ngly)t
oguesst hecompleteword.

I
fusercanfi
ndtheword,thenitpri
ntst
heuserwi
nsot
her
wisei
tpr
int
suserl
oset
he
gameandi
taskwhetherusercanconti
nuethegameornot.

S-ar putea să vă placă și