Socket
Book a DemoInstallSign in
Socket

github.com/fishjerky/go-bowling

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/fishjerky/go-bowling

v1.0.1-0.20230423020617-8fd58b4a81a2
Source
Go
Version published
Created
Source

GitHub Workflow Status Coverage Go Report Card Release

go-bowling"

Description

  • 提供Game Struct
  • 具兩個func
  • void 滾球(int 瓶數)
  • int 總分()

規則

  • 共10局
  • Bonus
  • Spare Bonus
    • 加下一局的第一次出手瓶數
  • Strike Bonus
    • 加下兩個出手瓶數
  • 注意事項
    • 第10局有三次機會

Test Case

  • testNewGame()
    • 初始化Game
    • expected: 0
  • test擊倒1瓶()
    • 測試擊倒1瓶
    • rest: 0
    • expected: 1
  • test測試全擊倒1瓶
    • 全都擊倒1瓶
    • expected: 20
  • test 1個Spare
    • 1st: 2,8 (Spare)
    • 2nd: 1,2
    • rest:0
    • expected: 14
  • test SpareBonus
    • case 1
    • 1st: 1,9 (Spare)
    • 2nd: 1,2
    • rest:0
    • expected: 14
    • case 2
    • 1st: 1,1
    • 2st: 1,9 (Spare)
    • 3nd: 1,2
    • rest:0
    • expected: 16
  • test 1個Strike
    • 1st: X (Strike)
    • 2nd: 1,2
    • rest: 0
    • expected: 16
  • test Perfect Game
    • 全都strike
    • 第十局有3次strike,共12個strike
    • expected 300

FAQs

Package last updated on 23 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.