Microsoft Excel VBA Programming for the Absolute Beginner Second Edition phần 6

Chương trình đánh giá điểm số của đại lý và người chơi và hiển thị một thông báo chỉ ra người chiến thắng, hoặc đẩy nếu đó là một tie. 20. Chương trình có trách nhiệm tính toán và hiển thị sự cân bằng của người chơi từ số tiền đặt cược và kết quả của một bàn tay. 21. Chương trình sẽ ra kết quả của mỗi bàn tay để bảng tính. | Chapter 6 VBA UserForms and Additional Controls 19. The program shall evaluate the dealer s and player s scores and display a message indicating the winner or push if it s a tie. 20. The program shall calculate and display the player s balance from the amount of the bet and the result of each hand. 21. The program shall output the result of each hand to the worksheet. The result consists of the dealer s and player s final score and the player s new balance. 22. The program shall allow the player to quickly clear the results from the worksheet from a click of a Command Button control located on the worksheet. Designing Blackjack This project uses many of the tools discussed in previous chapters of this book including various code structures and common ActiveX controls. In particular the project includes additional tools discussed in this chapter. These tools include UserForms and their code modules along with Frame and Combo Box controls. The Blackjack game runs from a VBA form that contains several ActiveX controls. The form is separated into a Dealer area and a Player area using Frame controls. The dealer frame contains these ActiveX controls Five Image controls for displaying images of cards representing the dealer s hand. A Combo Box control used as a dropdown list so the player can choose the number of decks 52 cards per deck used in the game. A Label control for displaying the score of the dealer s hand. The player frame contains these ActiveX controls Five Image controls for displaying images of cards representing the player s hand. A Combo Box control for the player to enter or select an amount to bet. A Label control for displaying the player s score. A Label control for displaying the player s current balance. A Command Button control for beginning and selecting a new game. A Command Button control for selecting another draw from the deck. A single Label control displays the result of each hand. Figure shows the Blackjack form named frmTable interface

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
8    556    1    29-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.