1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FizzBuzz、ズンドコ に続くの考えた! Bling-Bang-Bang-Born!!

Posted at

最近のわかものは…

ひょっとして ズンドコキヨシ わからないのでは??
と思ったので新しいネタ考えてました

流行りにのってこれ! Bling-Bang-Bang-Born!!

import random

# Bling-Bang-Bang
# Bling-Bang-Bang
# Bling-Bang-Bang-Born

bb = ['Bling','Bang']
correct = ['Bling','Bang','Bang','Bling','Bang','Bang','Bling','Bang','Bang']

count = 0

history = [''] * 9

for i in range(1000):
    for j in range(0,8):
        history[j] = history[j+1]

    x = random.randint(0,1)
    history[8] = bb[x]

    print(history)
    if history == correct:
        print('Born!!')
        break

print(i)

結果はこう。

  :
  :
['Bling', 'Bang', 'Bang', 'Bling', 'Bang', 'Bang', 'Bling', 'Bang', 'Bang']
Born!!
1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?