KENDRIYA VIDYALAYA N0-2 RAIPUR
COMPUTER SCIENCE PROJECT TOPIC : SNAKE SNAKE AND LADDER GAME
GUIDED BY : Mrs Tara Yadav
SUBMITTED BY : Amber Sing !"# $A%
TABLE O& CONTENTS Certificate
Acknowledgement
Requirements
Header files and their purpose
Coding
Output
Bibliography
Scope Of Future nhancement
Certifcate This is certi! that IS"AN #UPTA $ c%ass &II Scie'ce (A)* has s+ccess+%%! c$,%ete. their r$/ect $' c$,+ter ractica%s $r the AISSCE (A%% I'.ia Se'i$r Sch$$% Certifcate E1a,i'ati$') as rescrie. ! C3SE i' the !ear 2045-467
E1a,i'ers Si8'at+re9
Si8'at+re $ S+/ect $ Pri'cia%
Date9
Si8'at+re Teacher
:::::::::::::::::::: :::::::::::::::::::::
Ac;'$<%e.8e,e't
'e #an( )*r C)m+*#er S,ien,e #ea,er Mrs- TARA YADA. /)r g*idan,e and s*++)r#'e a0s) #an( )*r Prin,i+a0 T RUKMANI - 'e 1)*0d 0i(e #) #an( a00 )/ )*r /riends and #ea,ers /)r en,)*raging *s d*ring #e ,)*rse )/ #is +r)2e,#- &ina003 1e 1)*0d 0i(e #) #an( CBSE /)r giving *s #is )++)r#*ni#3 #) *nder#a(e #is +r)2e,#-
4EADER &ILES USED AND T4EIR PURPOSE =i'c%+.e>i$strea,7h?- /)r In+*#5O*#+*# O+era#i)ns
=i'c%+.e>c$'i$7h?- /)r ,0rs,r67 and ge#,67 /*n,#i)ns
=i'c%+.e>st.%i7h?- /)r genera#ing rand)m n*mber
=i'c%+.e>st.i$7h? - /)r s#andard I5O )+era#i)ns
=i'c%+.e>ti,e7h?- /)r mani+*0a#ing da#e and #ime in/)rma#i)n
CODING
8in,0*de9i)s#ream- 8in,0*de9,)ni)- 8in,0*de9s#d0ib- 8in,0*de9s#di)- 8in,0*de9#ime-
v)id dra1;0ine6in# n<,ar ,7= v)id b)ard67= v)id games,)re6,ar name!>?<,ar name">?
v)id main67
in# +0a3er!<+0a3er"<0as#+)si#i)n= ,ar +0a3er!name>?<+0a3er"name>?= ,0rs,r67= rand)mie67= dra1;0ine6F<7= ,)*#99Hnnnn##SNAKE LADDER GAMEnnnnH= dra1;0ine6F<7= ,)*#99HnnnEn#er Name )/ +0a3er ! :H= ge#s6+0a3er!name7= ,)*#99HnnEn#er Name )/ +0a3er " :H= ge#s6+0a3er"name7= 1i0e6+0a3er!9! @@ +0a3er"9!7 b)ard67= games,)re6+0a3er!name<+0a3er"name<+0a3er!<+0a3er"7= ,)*#99HnnJJJH 99+0a3er!name99H N)1 3)*r T*rn Press an3 (e3 #) +0a3 H= ge#,67= 0as#+)si#i)n+0a3er!= +0a3;di,e6+0a3er!7= i/6+0a3er!90as#+)si#i)n7 ,)*#99HnaO)+s Sna(e /)*nd Y)* are a# +)s#i)n H99+0a3er!99HnH= e0se i/6+0a3er!0as#+)si#i)n7
,)*#99HnGrea# 3)* g)# a 0adder Y)* are a# +)si#i)n H99+0a3er!= ,)*#99HnnJJJH99+0a3er"name99H N)1 3)*r T*rn Press an3 (e3 #) +0a3 H= ge#,67= 0as#+)si#i)n+0a3er"= +0a3;di,e6+0a3er"7= i/6+0a3er"90as#+)si#i)n7 ,)*#99HnnaO)+s Sna(e /)*nd Y)* are a# +)si#i)n H99+0a3er"99HnH= e0se i/6+0a3er"0as#+)si#i)n7 ,)*#99HnnGrea# 3)* g)# a 0adder Y)* are a# +)si#i)n H99+0a3er"99HnH= ge#,67= ,0rs,r67= ,)*#99HnnnH= dra1;0ine6F<7= ,)*#99Hnn##RESULTnnH= dra1;0ine6F<7= ,)*#99end0= games,)re6+0a3er!name<+0a3er"name<+0a3er!<+0a3er"7= ,)*#99HnnnH= i/6+0a3er!+0a3er"7 ,)*#99+0a3er!name99H Y)* are #e 1inner )/ #e gamennH=
e0se ,)*#99+0a3er"name99H Y)* are #e 1inner )/ #e gamennH= dra1;0ine6F<7= ge#,67=
v)id dra1;0ine6in# n<,ar ,7 /)r6in# i=i9n=i7 ,)*#99,=
v)id b)ard67 ,0rs,r67= ,)*#99HnnH= dra1;0ine6F<J7= ,)*#99Hn##SNAKE AT POSITIONnH= dra1;0ine6F<J7= ,)*#99Hn#&r)m #) " n#&r)m F #) "n#&r)m " #) F!n#&r)m Q #) !n#&r)m Q #) !n#&r)m #) QQn#&r)m #) Qn#&r)m F #) !n#&r)m FF #) n#&r)m F" #) !!n#&r)m #) n#&r)m #) Fn#&r)m #) ""nnH= dra1;0ine6F<J7=
,)*#99Hn## LADDER AT POSITIONnH= dra1;0ine6F<J7= ,)*#99Hn#&r)m #) "n#&r)m "! #) "n#&r)m Q #) n#&r)m F #) !n#&r)m " #) n#&r)m #) n#&r)m #) !nH= dra1;0ine6F<J7= ,)*#99end0=
v)id games,)re6,ar name!>?<,ar name">?
v)id +0a3;di,e6in# @s,)re7 in# di,e= di,erand)m67!=
,)*#99HnY)* g)# H99di,e99H P)in# H= s,)res,)redi,e= ,)*#99HN)1 3)* are a# +)si#i)n H99s,)re= s1i#,6s,)re7 ,ase :s,)re"=brea(= ,ase F :s,)re"=brea(= ,ase " :s,)reF!=brea(= ,ase Q :s,)re!=brea(= ,ase Q :s,)re!=brea(= ,ase :s,)reQQ=brea(= ,ase :s,)reQ=brea(= ,ase F :s,)re!=brea(= ,ase FF :s,)re=brea(= ,ase F" :s,)re!!=brea(= ,ase :s,)re=brea(= ,ase :s,)reF=brea(= ,ase :s,)re""=brea(= ,ase :s,)re"=brea(= ,ase "! :s,)re"=brea(= ,ase Q :s,)re=brea(= ,ase F :s,)re!=brea(= ,ase F :s,)reQ=brea(= ,ase " :s,)re=brea(=
,ase :s,)re=brea(= ,ase :s,)re!=
OUTPUT
Re@+ire,e'ts "ARDARE REBUIRED Pri'ter* t$ ri't the re@+ire. .$c+,e'ts $ the r$/ect C$,act Drie Pr$cess$r 9 Pe'ti+, III Ra, 9 6 M3 "ar. .is; 9 20 #7
SOTARE REBUIRED Oerati'8 s!ste, 9 i'.$
3I3LIO#RAP"Y COMPUTER SCIENCE IN CFF 3Y9 G SUMITA ARORA COMPUTER SCIENCE TEAC"ER9 - Mrs7 Tara Ya.a (P7#7T C$,+ter Scie'ce) se$rta%7c$, <<<7cse$rta%7c$, <<<7cse$rta%7c$,
SCOPE O UTURE EN"ANCEMENT Te game ,an be re,rea#ed 1i# #e gra+i,s #) ma(e i# 0))( a##ra,#ive- Tere is a0s) a s,)+e #a# game ma3 ave dieren# 0eve0s- Te game ,an a0s) be ,rea#ed in
s*, a 1a3 #a# i# be,)mes m)re ,a00enging-