【初心者】Java の宿題ここで答えます 5.0【歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0088デフォルトの名無しさん
05/02/08 16:25:16Write a program to allow a randomly placed remote-controlled robot (in a grid environment) to move to its home.
(The home is also randomly placed, and needs to be shown on the grid.)
The user will specify the robot moves.The robot can move horizontally or vertically but not diagonally to an adjacent cell.
It must pay $1.00 travel fee for every move it makes.
Calculate the total cost to go home.The program should not let the user drop the robot off the planet.
You can use keys such as “i” for up, “j” for left, “l” for right and “m” for down, or the arrow keys, or mouse clicks on a cell.
(The mouse clicks are harder to program.)
Update the world after each move to show the new location of the robot, relative to the home location.
The user can specify the size of the world (in terms of number of cells).
The world is a flat square (that is, it is an nXn matrix.) Using a GUI interface will earn a maximum of 110 points.
There is only one player at this time in this game.
The user can also reset a game or play a new game when the current game is over.
英文で失礼します。以下概略です。
ロボットをキーボードで操作してHOMEに帰すゲームです。
以下がゲームの必要事項です。
スタートボタンを押すとロボットとHOMEをランダムで格子状のステージに配置します。
HOMEはプレイヤーにはわからないようにします。
ロボットはキーボード操作でマスを上下左右に移動できます。(斜めはなし)
上=I, 下=M, 右=L, 左=Jのキー配置です。
ロボットが一マス動くごとに1ドルのコストがかかり、それを計算して最終的にトータルコストを表示します。
ロボットが一マス動くごとにステージをアップデートしてHOMEまでの距離を表示します。
ロボットがHOMEについた時点でゴールです。
ゴール後ウィンドウをポップアップさせてトータルのコストとリプレイするかしないかを表示します。
アプレットとgridLayoutを使って作ります。
以上です。
どなたかお願いいたします。
■ このスレッドは過去ログ倉庫に格納されています