Java代做编程辅导:CS415 Blackjack

2022-10-27 17:55:14 浏览数 (1)

全文链接 :tecdat.cn/?p=29682

Introduction

一个21点的扑克牌游戏,作业提供了框架以及游戏引擎,不过UI库是学校内部的,需要学习成本。刨除UI部分,整体不难,无非就是deal, hit, stand三个按钮,然后label显示得分。

Requirement

We have written several classes that set up the application, the cards and the game board. You will need to write a class named Game and other classes of your choice that will make the game functional. The game should follow the above rules and you should display a control panel that displays scores and control buttons to run the game.

The Starting Files

Start by downloading the files posted on the public 8P directory.

  • Board.java Our class that represents the playing board, do not edit this file.
  • Card.java Our class that represents one card, do not edit this file.
  • BlackJackApp.java Our class, the main application, do not edit this file.
  • Game.java A skeleton for your main class.
  • cards_gif.jar A jar file containing the card images.

You will be writing the Game class and other classes as required by your design. Do not change and do not submit Board.java, Card.java, BlackJackApp.java or any images. Submit only Game.java and other java files that you write.

The Game Class

This is the primary class that you will write, as it is now it is just a skeleton that sends a few test messages to the Board. You will need to add the code that plays the game and displays the information. You will need to create a display text box to show the following information:

  • The amount of money the player has (starts at $500)
  • The players current card count
  • The result and win/loss amount for the current deal and messages saying what to do next. (You will probably want to create a “Display” class to handle these tasks.)
  • You will need to add labeled buttons (clickable Rectangles) to get the users choices, the choice are:
  • Deal: Deal a new hand (A new hand can’t begin until the previous hand is finished)
  • Hit: Player gets another card
  • Stand: Player ends the hand (then dealer finished hand and bets are paid)

Chunking and Design

Don’t try to do everything in one method or one class, it will become much too complicated. Write multiple classes and many “helper” methods that handle some small part of the problem. Breaking a problem up into these smaller pieces is sometimes called “chunking”. Poorly chunked code may lose points. As usual, think carefully about the class design, for example you probably want a separate class to represent the display and another class to represent the buttons, etc..

Evaluation and Incremental development

Develop your program in small steps; the following suggests some useful steps and how we will evaluate your assignment. If, when you develop your program you cannot finish one of the following steps and it breaks the program, be sure to backup to where the program was working. A program that doesn’t compile or crashes is worth a lot less than a program that does just the first step below.

0 人点赞