— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet140/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   136   137   138   139   140   141   142   143   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

Setup: When the game program is launched, the 
computer places three Dot Coms, randomly, on the 
virtual 7 x 7 grid. When that’s complete, the game 
asks for your fi rst guess.
How you play: We haven’t learned to build a GUI 
yet, so this version works at the command-line. The 
computer will prompt you to enter a guess (a cell), 
which you’ll type at the command-line (as “A3”, “C5”, 
etc.). In response to your guess, you’ll see a result at 
the command-line, either “hit”, “miss”, or “You sunk 
Pets.com” (or whatever the lucky Dot Com of the day 
is). When you’ve sent all three Dot Coms to that big 
404 in the sky, the game ends by printing out your 
rating.
7 X 7 grid
File Edit Window Help Sell
%java DotComBust
Enter a guess A3
miss
Enter a guess B2
miss
Enter a guess C4
miss
Enter a guess D2
hit
Enter a guess D3
hit
Enter a guess D4
Ouch! You sunk Pets.com : ( 
kill
Enter a guess B4
miss
Enter a guess G3
hit
Enter a guess G4
hit
Enter a guess G5
Ouch! You sunk AskMe.com : ( 
kill
Enter a guess A7
miss
Enter a guess B7
A
B
C
D
E
F
G
0 1 2 3 4 5 6
AskMe.com
Pets.com
G
o2.c
om
starts at zero, like Java arrays
part of a game interaction
You’re going to build the 
Sink a Dot Com
game, with 
a 7 x 7 grid and three 
Dot Coms. Each Dot Com 
takes up three cells.
each box 
is a “cell”



Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   136   137   138   139   140   141   142   143   ...   555




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish