• Java代做编程辅导:CS415 Blackjack


    全文链接 :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.
  • 相关阅读:
    [设计模式] 10 外观模式 facade
    [设计模式] 11 享元模式 Flyweight
    [设计模式] 9 装饰者模式 Decorator
    [设计模式] 8 组合模式 Composite
    float2int
    《ASP.NET》数据绑定——GridView
    Android Studio左边栏Project不见了?
    Linux下的五种I/O模型
    Shell编程入门(第二版)(下)
    Android訪问网络,使用HttpURLConnection还是HttpClient?
  • 原文地址:https://www.cnblogs.com/tecdat/p/16833193.html
Copyright © 2020-2023  润新知