9
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?

More than 5 years have passed since last update.

ใƒ–ใƒ’ใ‚ฃ ๐Ÿท

Last updated at Posted at 2018-08-09

๐Ÿท

Ruby

buhii = Enumerator.new { |y| loop { y << 'ใƒ–ใƒ’ใ‚ฃ'.split('').sample } }
buhii.take(50).join
# "ใƒ’ใ‚ฃใƒ–ใƒ–ใ‚ฃใ‚ฃใƒ’ใ‚ฃใƒ–ใƒ–ใƒ–ใ‚ฃใƒ–ใƒ’ใ‚ฃใƒ’ใ‚ฃใ‚ฃใƒ’ใ‚ฃใƒ’ใƒ’ใƒ’ใƒ’ใƒ–ใƒ–ใƒ–ใ‚ฃใƒ–ใƒ’ใƒ’ใƒ’ใƒ–ใ‚ฃใ‚ฃใƒ’ใƒ–ใƒ’ใ‚ฃใ‚ฃใƒ’ใƒ–ใƒ’ใƒ’ใƒ’ใƒ–ใƒ’ใ‚ฃใƒ–ใƒ–"

๐Ÿท ใŠใพใ‘: Mac ใฎๆ–นใฏ :point_down_tone1:

system("say #{buhii.take(50).join}")

Python

import itertools
import random

def buhii():
  while True:
    yield random.choice([chr for chr in 'ใƒ–ใƒ’ใ‚ฃ'])

''.join(itertools.islice(buhii(), 50))
# 'ใ‚ฃใƒ–ใƒ–ใƒ’ใƒ’ใƒ’ใƒ’ใ‚ฃใƒ–ใƒ–ใƒ–ใƒ’ใ‚ฃใ‚ฃใ‚ฃใ‚ฃใƒ–ใƒ–ใƒ’ใƒ’ใƒ–ใƒ–ใƒ’ใƒ’ใ‚ฃใ‚ฃใƒ’ใ‚ฃใ‚ฃใ‚ฃใƒ–ใƒ–ใ‚ฃใ‚ฃใƒ–ใ‚ฃใ‚ฃใƒ’ใƒ’ใƒ’ใ‚ฃใƒ’ใƒ’ใƒ–ใ‚ฃใ‚ฃใƒ’ใƒ’ใƒ’ใ‚ฃ'

JavaScript

const sample = (array) => array[Math.floor(Math.random() * array.length)];
const times = (n, fn) => (new Array(n)).fill(null).map(fn);

const buhii = function* () { while (true) yield sample('ใƒ–ใƒ’ใ‚ฃ'.split('')) };
times(50, () => buhii().next().value).join('');
// 'ใƒ’ใƒ–ใƒ–ใƒ’ใ‚ฃใ‚ฃใ‚ฃใ‚ฃใƒ’ใ‚ฃใƒ’ใƒ’ใƒ–ใƒ–ใ‚ฃใ‚ฃใƒ–ใ‚ฃใ‚ฃใ‚ฃใƒ’ใƒ–ใƒ’ใƒ’ใƒ–ใƒ’ใƒ’ใƒ’ใƒ–ใ‚ฃใƒ–ใƒ–ใƒ’ใƒ’ใƒ’ใƒ’ใƒ–ใƒ’ใ‚ฃใƒ’ใƒ’ใƒ’ใƒ’ใƒ–ใ‚ฃใƒ’ใƒ’ใ‚ฃใ‚ฃใ‚ฃ'
9
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
9
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?