15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

62<br />

Teaching Languages<br />

Figure 3-4:<br />

Using a<br />

battle robot<br />

to study<br />

<strong>programming</strong><br />

can<br />

make<br />

<strong>programming</strong><br />

more<br />

exciting.<br />

Instead of writing a program just to control a robot, these games <strong>for</strong>ce you to<br />

write a program to move a robot on-screen, search <strong>for</strong> other robots nearby,<br />

and then attack those other robots with a cannon.<br />

After you finish your program, you can see the results by watching your<br />

robot battle another robot in a gladiator-style battle. Write a “good” program,<br />

and your robot can defeat another robot. Write a “bad” program, and<br />

your robot gets blasted into chunks of (virtual) charred metal.<br />

To program a “battling robot,” use a simplified version of a popular <strong>programming</strong><br />

language, such as Java or C++. That way you not only figure out the<br />

basics of a popular <strong>programming</strong> language, but you can also start writing<br />

“real” programs that actually do something interesting right from the start.<br />

Table 3-1 lists some popular “battling robot” <strong>programming</strong> games.<br />

Table 3-1<br />

Popular “Battling Robot” Programming Games<br />

Program Name Language Used Where to Find It<br />

Robocode Java http://robocode.source<strong>for</strong>ge.net<br />

C++ Robots C++ http://www.gamerz.<br />

net/c++robots<br />

CRobots-3D C http://antru.ru/crobots3d

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!