かずきのBlog

C#やJavaやRubyとメモ書き

目次

Blog 利用状況

ニュース

わんくまBlogが不安定になったため、前に書いてたはてなダイアリーにメインを移動します。
かずきのBlog@Hatena
技術的なネタは、こちらにも、はてなへのリンクという形で掲載しますが、雑多ネタははてなダイアリーだけに掲載することが多いと思います。
コメント
プログラマ的自己紹介
お気に入りのツール/IDE
プロフィール
経歴
広告
アクセサリ

書庫

日記カテゴリ

[Other]最近は

最近会社の部署内で、ボーリングのスコア計算のプログラムを作るということがPGのネタのお題にあがっている。
最後をどう扱うか?テストどうやるか?というところがポイントになるらしぃ。

確かに、ボーリングのスコアの数え方はとてもシンプル。Wikipediaには下のように書いてある。

  1. フレームにおいてスペア・ストライクがない場合(オープンフレームと呼ぶ)、2回の投球で倒したピンの本数がそのフレームの得点となる。
  2. スペアを出した場合、倒した本数である10点に加え、次の1投球で倒したピンの本数がこのフレームの得点に加算される。
  3. ストライクを出した場合、倒した本数である10点に加え、続く2投球で倒したピンの本数が加算される。つまり次の投球もストライクだった場合は、さらにその次の投球(2フレーム先の第1投球)で倒したピンの本数まで加算される。
  4. 第10フレームのみ、スペア・ストライクを出した場合、3投して倒したピンの総数を第10フレームの得点として計算する。
  5. 各フレームの得点の合計が1ゲームの得点となる。最高得点は300点となる。

シンプルだけど、実装はそれなりに大変で、テストも大変。う~ん、どう組もう。

投稿日時 : 2008年10月7日 2:28

Feedback

# re: [Other]最近は 2008/10/07 12:56 凪瀬

後ろからループすれば簡単なんじゃないですかねぇ。

# re: [Other]最近は 2008/10/08 2:55 art55

こんばんわ。
うちの会社はIT業界に属している会社なのにプログラミングの話が全く話題にのぼりません。
かずきさんが、ものすごくうらやましいです。

# re: [Other]最近は 2008/10/09 7:13 かずき

>凪瀬さん
何かそんな感じでいけそうですね~。
新人さんに時間があるときに考えて作ってみてっていうので出た課題なんです。

>art55さん
うちは部署柄そういう話題があがったりすることがちらほらあるんですよ~。

# welded ball valve 2012/10/18 21:33 http://www.jonloovalve.com/Full-welded-ball-valve-

I believe this web site contains some really good info for everyone :D. "Nothing great was ever achieved without enthusiasm." by Ralph Waldo Emerson.

# Womens TK Society 2012/12/07 22:29 http://supratkstore.webs.com/

I was examining some of your articles on this internet site and I think this internet site is very informative ! Keep posting .

# moncler online 2012/12/08 3:06 http://2012monclerdownjacket1.webs.com/

Some really wonderful articles on this internet site , appreciate it for contribution.

# code promotion la redoute 2012/12/12 11:04 http://www.promolaredoute.com/

Love, camaraderie, caution, do not link citizens as much as a well-known hate intended for a product.

# longchamp sacs pliage 2012/12/14 20:43 http://www.soldesacslongchamp.info/category/longch

I realize everybody will probably hate with them, but I don't believe they appearance so negative.

# kate moss longchamp 2012/12/15 15:30 http://www.soldesacslongchamp.info/category/kate-m

I am sure I will visit the place once again soon.

# burberry outlet 2012/12/15 22:59 http://www.burberryuksale.org/category/burberry-sa

this is usually something i have never ever previously read.

# longchamp pliage achete 2012/12/16 17:56 http://www.saclongchampachete.com/category/longcha

I have not looked inside Sennheisers as well as am in search of new tote.

# burberry uk online 2012/12/17 2:52 http://www.burberryoutlet2012.info/category/burber

Think it as being a journal as well as a magazine involving general interest for people who to read through. Funny, witty, controversial, entertaining, useful, acerbic, thoughtful, serious, curious, unexpected comebacks are actually welcome.

# トリーバーチ 靴 2012/12/17 20:19 http://www.torybruchjp.info/category/トリーバーチ

We found lots of great DVDs that people were excited to watch after again. Over the length of two months.

# burberry uk 2012/12/18 14:36 http://www.burberryuksale.org/category/burberry-20

I have not looked within Sennheisers in addition to am trying to find new tote.

# sac burberry soldes 2012/12/18 14:41 http://www.sacburberryecharpe.fr/category/sac-burb

I have never looked directly into Sennheisers along with am short of new tote.

# burberry en ligne 2012/12/19 13:24 http://sacburberrysoldesfr.webnode.fr

My organization is impressed by the grade of information in this particular website. There are a lot of good methods here.

# burberry bags 2012/12/21 2:28 http://burberryoutlet2013sale.webeden.co.uk

Keep the excellent deliver the results.

# sneakers isabel marant 2012/12/22 17:18 http://sneakersisabelmrant-paris.webnode.fr

Keep the excellent succeed.

# destockchine 2013/01/10 22:36 http://www.destockchinefr.fr/nike-shox-pas-cher/ni

Like can be the merely sane and in addition positive answer to the problem involved with real human being.
destockchine http://www.destockchinefr.fr/nike-shox-pas-cher/nike-shox-nz-2-pas-cher/

# Sarenzalando 2013/01/11 11:06 http://www.robenuk.eu/

Even if you is going to you want to keep hidden-secret in an enemy, discern this can to not an associate.
Sarenzalando http://www.robenuk.eu/

# www.K77.fr 2013/03/04 23:15 http://www.k77.fr/

Tend not to socialize which can be cosy to be with. Connect with others that will get to prise your own self it. www.K77.fr http://www.k77.fr/

# air jordan retro 7 2013/03/04 23:15 http://www.jordanretro7air.com/

True love can be the stimulated consideration to your everyday living also , the increase of what my spouse and i seriously like. air jordan retro 7 http://www.jordanretro7air.com/

# casquette la 2013/03/05 0:38 http://www.b66.fr/

A genuine family member certainly one just who overlooks your actual downfalls together with can handle your actual successes. casquette la http://www.b66.fr/

# France Marque 2013/03/05 0:38 http://www.g33.fr/

Precise acquaintanceship foresees the requirements of many instead glorify it is really own personal. France Marque http://www.g33.fr/

# usinefr 2013/03/05 0:38 http://www.f77.fr/

Mainly because another person doesn‘metric ton adore you the way we want them for,doesn‘metric ton indicate they can assume‘metric ton adore you with they've. usinefr http://www.f77.fr/

# casquette unkut 2013/03/05 0:40 http://www.b66.fr/

In prosperity each of our acquaintances are familiar with usa; when trouble could each of our acquaintances. casquette unkut http://www.b66.fr/

# robenuk 2013/03/06 20:56 http://www.c88.fr/

Little person might be priced at your actual tears, and therefore the anyone that is without question triumphed‘h help you make yowl. robenuk http://www.c88.fr/

# Jordan Retro 11 2013/03/06 20:58 http://www.nikerow.com/

Under no circumstances grimace, even when you might pitiful, sinse you can't say for sure who's going to be plummeting in love with your trusty laugh. Jordan Retro 11 http://www.nikerow.com/

# code reduction la redoute 2013/03/06 21:01 http://www.k88.fr/

Put on‘T waste product this moment around the individual/partner,who else isn‘T prepared waste product its energy on you. code reduction la redoute http://www.k88.fr/

# casquette obey 2013/03/15 5:04 http://www.b44.fr/

Father‘big t make an attempt over-time, the correct factors are supplied once you a minimum of hope those to. casquette obey http://www.b44.fr/

# destockhine 2013/03/16 8:49 http://www.b77.fr/

No need to socialize more enjoyable to get along with. To understand that will compel to lever yourself over. destockhine http://www.b77.fr/

# casquette obey 2013/03/16 9:56 http://www.a44.fr/

Might be Fin intends united states of america to meet a selection of wrong users prior business meeting a good choice, to ensure whenever you conclusively fulfill the man or women, exploration have learned to indeed be thankful. casquette obey http://www.a44.fr/

# casquette volcom 2013/03/22 21:04 http://f22.fr/

Glee works as a aroma you cannot strain to do with some others without requiring having a only a few sheds to do with your true self. casquette volcom http://f22.fr/

# usine23 2013/03/25 2:26 http://e55.fr/

That most detrimental means to let pass another thought of as as well as accurate by the group recognizing yourrrre able to‘r have them. usine23 http://e55.fr/

# 3suisses 2013/04/07 1:10 http://ruenee.com/

A real mate only what person overlooks your favorite failures and even can handle your favorite success. 3suisses http://ruenee.com/

# Laredoute 2013/04/07 5:09 http://ruezee.com/

Somebody which you procure with the presents could well be purchased from most people. Laredoute http://ruezee.com/

# spartooo.fr 2013/04/07 14:39 http://www.spartooo.fr/

Will be last a long time the moment each close friend seems they have a slight brilliance for several alternative. spartooo.fr http://www.spartooo.fr/

# Eram 2013/04/08 1:49 http://rueree.com/

A real colleague is an exactly who overlooks your favorite deficiencies and thus tolerates your favorite positive results. Eram http://rueree.com/

# tbQeGKYPMgBVBhUroVE 2015/01/11 14:08 varlog

sjU0lv http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com

# wJbjfTqAggLoQB 2015/01/26 19:00 Olivia

How much does the job pay? http://www.consensusortho.com/index.php/patients/ buy dormicum midazolam In the longer term, investors remain divided over Dell's prospects. Some are ready to cash out of a company increasingly vulnerable to a crumbling PC market. The company created by Dell in his dorm room in 1984, and which rapidly grew into a global market leader renowned for innovation, is a now shadow of its former self.

# MKjEthkQbqSVxS 2015/01/26 19:00 Antoine

I'm on business http://www.examplequestionnaire.com/partners/ how many mg of klonopin to get you high There are more subtle nods to the history in the furnishings. There is no television, for example. And portraits of historic characters including Henry VIII and Jane Seymour peer down from the walls and over beds, reminding visitors just how old Astley is.

# mFJTvpnFmVngjhiX 2015/01/26 19:01 Mohamed

I really like swimming http://www.medicalreformgroup.ca/newsletters/ oxycodone vs oxycodone acetaminophen On Saturday, a spokesman for the Tehreek-e-Taliban criticized Sharif, saying comments by Sharif indicating that the militants must lay down their weapons and respect the constitution indicated the new leader is not serious about peace talks. Previously Sharif had not given preconditions for the talks.

# sMlOiBBXpaRY 2015/01/28 0:56 Vance

An accountancy practice http://www.webface.ie/our-advantages.html imovane sans prescription "I'm really excited about this music education center and the fact that right now they have three different classes going on today," Swift said in an interview after the ceremony. "It's really exciting that we can be here on a day when they're not only unveiling it, but they're starting to actively use it today."

# ycxrarvPTIXviRfA 2015/01/28 0:56 Makayla

Insufficient funds http://www.hollandpompgroep.nl/atex where can i buy zopiclone online “But it’s a difficult question because it’s Thursday and we’ll have to see how things manifest themselves. If Arsenal don’t come back in, I think he’ll be involved. He’s showing signs of that and hopefully he will.”

# loFEVGrIQYAiXdEjmcc 2015/02/04 17:28 Reinaldo

Hello good day http://www.pointreyesseashore.com/blog/ bactrim cost The measure expands an earlier ban on lead hunting ammunition in California condor habitat. The new law covers all wildlife, including "game mammals, game birds, nongame birds and nongame mammals" such as coyotes.

# meEFPJqbHP 2015/02/05 22:28 Robby

I'm in a band http://www.blue-lemons.com/about order levofloxacin Amber Portwood was convicted in June 2011 of assaulting her ex-fiance and baby daddy, Gary Shirley, and was given a suspended two-year jail sentence. The Madison County prosecutor's office reportedly decided to add an additional charge on Dec. 27, 2010 - neglect of a dependent, a felony - and an arrest warrant was issued.

# ihZGxpbGFiIJLAKEpLO 2015/02/06 9:18 Scottie

Have you got any ? http://www.optimizacijasajtova.com/optimizacija-sajta-seo.html loan with no credit check online About scotus , what amazes me is ACA was deemed a TAX. Our constitution says that any type of revenue bill that is made HAS to start in the House, yet ACA was started in the Senate. With careful wording , some manipulation, added and subtracting of material, presto .. Senate worked its way through a hole in the system and got ACA through.

# fSfNfNgghs 2015/02/06 9:18 Issac

Whereabouts are you from? http://www.argentfm.com/quality/ no credit cash advance no facing phone number In June, Dr. Mark Ginsburg, chief of thoracic surgery at Good Samaritan Regional Medical Center in Suffern, N.Y., traveled to Israel to perform an operation to give Maria a phrenic nerve pacemaker. Much as cardiac pacemakers do for the heart, phrenic nerve pacemakers send electrical current to the diaphragm to stimulate breathing function.

# YXTYdgcZbpJaXWTFkB 2015/02/07 3:04 Lenard

I'll text you later http://www.wonderbra.ca/products-page/ tenormin 100 mg a cosa serve The bank is moving the global co-head of its technology,media and telecom group to San Francisco from New York,bolstering its Silicon Valley investment banking presence inanticipation of more deals in the sector, two sources familiarwith the move said on Thursday.

# OnuMNFaBVvLbowzb 2015/02/07 3:04 Jefferey

We were at school together http://www.racc.org/about/equity buy quetiapine tablets As Chairman and CEO Jeffrey Lurie just announced in a press conference, Donovan McNabb will be inducted into the Eagles Hall of Fame and have his No. 5 jersey officially retired by the team on September 19 in front of fans at Lincoln Financial Field in a nationally televised game against the Kansas City Chiefs.

# wXlDptEtNkQAPpXzC 2015/02/09 2:23 Gerard

I'm doing a masters in law http://atecuccod.com/index.php/kapcsolat equity loans in texas Allen hadn�t smoked a million cigarettes by that point. He didn�t have that low, gravelly voice that everyone knows from all his recordings. And John, our director, was very firm about the fact that he didn�t want us to research our characters beyond the age we were playing them. He said, �You�re not playing Allen Ginsberg the great American poet. You�re playing Allen Ginsberg, a boy from Paterson, New Jersey, desperately hoping to get into Columbia University.�

# upLsIjvAMwqstflE 2015/02/09 2:23 Samantha

History http://atecuccod.com/index.php/aszf 90 day bad credit loans He said the administration will push for legislation next year to regulate such programs so authorities know where any programs housing kids more than 60 days are operating and so officials are "able to go in and make sure that whatever youth are in there are safe."

# oFZCgcQUNUXcRbQV 2015/02/10 10:42 Alfred

Why did you come to ? http://www.groteverhalen.info/index.php/agenda chicago loan The second inaugural was January 20. Obama delivered a bracing address that frozen day. By contrast, does Obama seem world–weary and sapped this summer? The bipartisan immigration bill recently passed by the Senate seems likely to be the next casualty of his hope and overconfidence he could "change the culture" of Washington. Its prospects of ever reaching the House floor are grim.

# KsJDYMFRCFoLNTprzj 2015/02/10 15:54 Roosevelt

On another call http://www.moldotrans.ro/drive-test/ buy cheap benicar Schools designated by U.S. News as Unranked were excluded from this list. U.S. News did not calculate a numerical ranking for Unranked programs because the program did not meet certain criteria that U.S. News requires to be numerically ranked.

# ulZlMdNywwCvWs 2015/02/10 15:54 Sergio

I live in London http://www.fixadoptsave.org/take-the-pledge/ Nizoral Otc Of course, the focus has been on the possible returns of Derek Jeter (soon), Alex Rodriguez (not so soon) and Curtis Granderson (who knows when?). That trio will be under immense pressure to add muscle to a lineup that has been swinging wet newspapers for far too long.

# ZzpGlmVplVGOQfP 2015/02/10 15:54 Earle

I'd like some euros http://www.fixadoptsave.org/take-the-pledge/ Generic Ketoconazole Uralkali's shares have recouped most of their losses sinceplunging nearly 19 percent when the firm quit the joint ventureon July 30, and the firm has a current market capitalisation ofaround $16.5 billion.

# GgRxsxaXfwyqtB 2015/02/10 15:54 Jarvis

Can you hear me OK? http://digitallocksmithsinc.com/get-informed/ allopurinol 20 mg A downgrade of the Spanish sovereign to below 'BB ' would be likely to result in an immediate downgrade. If the sovereign was downgraded to 'BB ' Fitch would consider the implications for funding costs and market access for Spanish corporates and the company's prevailing liquidity, while recognising TEF's solid geographic diversification.

# FjidWtHcOFgQFM 2015/02/10 15:54 Leslie

Could I ask who's calling? http://www.fixadoptsave.org/take-the-pledge/ Nizoral Online Cruz signed up in the spring, joining a partnership between Roc Nation and Creative Artists Agency (and NFL superagent Tom Condon), letting them negotiate what eventually became a six-year, $45.879 million contract. It was a risky move even with Condon on board, because Jay Z had no experience at all as a sports agent.

# btOyzoeRrHQpqbbxg 2015/02/11 18:52 Demetrius

The line's engaged http://thisisaway.org/about/ st annes online loan center "I don't know yet that I'd call it standard. It's headed inthat direction, but I don't know that we're quite there yet,"said the portfolio manager, noting that covenants remain a keynegotiating point in loan syndications.

# bdUfzROHeqivHhbXaFg 2015/02/11 18:52 Rigoberto

I study here http://compostcrew.com/faq/ online loan cibc Even if you�ve downed soda exclusively for years, your potassium levels and markers for normal heart function can improve in as little as one week, says Saoudi. However, if your potassium levels are already low (the case for 98 percent of Americans, according to the CDC), you should probably drink even less soda than the recommended daily limit of one 16-ounce bottle a day.

# pGVXjDgPLftHWeUsW 2015/02/24 14:49 Jeffery

I'm self-employed http://www.streamsweden.com/support/ buy cheap inderal If enough people define themselves as “other” it could put pressure on leaders to change the constitution – shifting Bosnia’s balance of power towards the ethnic groups that are currently unrecognised.

# ZgBXcMkaIGddyIsAMsQ 2015/02/26 21:02 Elias

On another call http://www.nude-webdesign.com/client-portfolio-page/ abilify 15 mg tab We mentioned his long track record of service, but really highlighted his organizing a large group to train for a marathon and raise money for a six-year-old girl with leukemia. Abhi discussed his own training process, recruiting and engaging others, planning multiple fundraising events and the leadership ups and downs that he encountered throughout the process.

# JVVHumuZPwVqUQBh 2015/02/26 21:02 Tomas

It's a bad line http://www.nude-webdesign.com/website-design-development/ abilify aripiprazole 5 mg Praktiker, grappling with a decline in sales andprofitability since it ended a "20 percent off everything"discount strategy, had been in the process of converting many ofits Praktiker-branded stores to the more successful Max Bahrbrand, which traditionally had better profit margins.

# MWmFCajYgcUqVj 2015/02/26 21:02 Ellsworth

Can I call you back? http://www.nude-webdesign.com/website-design-development/ abilify aripiprazole 5 mg "We are watching this very closely like everyone else. Somepeople have been going into cash. I wish we were all focusing onmatters of economics and earnings, but we are unfortunatelytrading on this soap opera," said Michael Cuggino, president andportfolio manager at Permanent Portfolio Funds.

# BPffmPWRid 2015/02/28 4:00 Zoey

Where are you calling from? http://www.holysoakers.com/agence/ buy stromectol online In the Associated Press case, investigators focused on how reporters learned about a U.S. operation in Yemen to foil a plot to bomb an airliner, government officials have said. An AP story in May 2012 described the plot. The AP has reported that it delayed publishing the story at the request of government officials until security concerns were allayed.

# nHHDawwqgGeSTBXlLC 2015/02/28 7:27 Murray

Do you like it here? http://www.europanova.eu/tag/crise/ bimatoprost in south africa AT&T Inc, the No. 2 U.S. mobile service provider, willhave exclusive rights to let its customers customize the phonefrom a selection of 18 colors for the back, two colors for thefront and seven accent colors for an undisclosed time period.

# YHBGQRVzJnOMom 2015/02/28 7:27 Eusebio

The manager http://version22.com/about/ xalatan price philippines "Choosing DeGeneres, known for her kindler, gentler humor,signals that the Academy's next awards show will have adecidedly different tone than the 85th Academy Awards," trademagazine The Hollywood Reporter wrote.

# zzXYjyARShOHZ 2015/02/28 7:27 Rickey

Did you go to university? http://zoombait.com/z-hog/ Alesse Spotting Following Cote's ruling, the government asked that sherequire Apple to end contracts with the five publishers and beprevented for five years from entering contracts that theJustice Department says would restrict Apple from competing onprice.

# eHrfCZafRtxMnf 2015/02/28 7:27 Keith

Could you please repeat that? https://rarcc.org/contact-us generic bimatoprost The bank did not outline what the increased reserves werespecifically for, and does not say what its overall litigationreserves are. Morgan Stanley detailed the additional accruals,as well as updates on several ongoing legal proceedings, in its10-Q quarterly filing with the U.S. Securities and ExchangeCommission.

# OBtWgQWbEmFFpOSzFA 2015/02/28 7:27 Kraig

On another call http://www.bethelhebrew.org/about-us Doxazosin Mesylate 8 Mg Forty-seven per cent said it would make it harder to find skilled workers, while 3pc said it would be easier. Just over half said it would harm competitiveness, against 15pc who thought it would help.

# UwzDHFvausOMPxe 2015/02/28 7:27 Armand

What do you study? http://version22.com/contact/ latanoprost mechanism of action "It is no secret how much I have always loved EastEnders and Peggy Mitchell - and by the number of times I'm constantly stopped by the great British public and asked either 'when are you coming back' or 'please say get out of my pub', it seems they have too," she said.

# prescription without a doctor's prescription - https://cheapdr.top/# 2023/04/03 15:16 Dikolipo

prescription without a doctor's prescription - https://cheapdr.top/#

# gel per erezione in farmacia https://viasenzaricetta.com/# 2023/04/16 13:04 ViaSenza

gel per erezione in farmacia https://viasenzaricetta.com/#

# prednisone where can i buy - https://prednisonesale.pro/# 2023/04/22 15:05 Prednisone

prednisone where can i buy - https://prednisonesale.pro/#

# buy cytotec pills - https://cytotecsale.pro/# 2023/04/29 4:35 Cytotec

buy cytotec pills - https://cytotecsale.pro/#

# over the counter insulin https://overthecounter.pro/# 2023/05/08 22:39 OtcJikoliuj

over the counter insulin https://overthecounter.pro/#

# online ed medications: https://edpills.pro/# 2023/05/16 3:13 EdPillsPro

online ed medications: https://edpills.pro/#

# erectile dysfunction drug https://edpill.pro/# - ed treatment pills 2023/06/27 14:33 EdPills

erectile dysfunction drug https://edpill.pro/# - ed treatment pills

# Paxlovid over the counter https://paxlovid.store/
buy paxlovid online 2023/07/13 21:39 Paxlovid

Paxlovid over the counter https://paxlovid.store/
buy paxlovid online

# paxlovid india https://paxlovid.life/# Paxlovid buy online 2023/07/26 6:11 Paxlovid

paxlovid india https://paxlovid.life/# Paxlovid buy online

# ï»¿cytotec pills online https://cytotec.ink/# - order cytotec online 2023/07/27 1:08 PillsFree

cytotec pills online https://cytotec.ink/# - order cytotec online

# valtrex valacyclovir https://valtrex.auction/ buy generic valtrex online canada 2023/10/24 22:04 Valtrex

valtrex valacyclovir https://valtrex.auction/ buy generic valtrex online canada

タイトル  
名前  
Url
コメント