Created
August 18, 2019 17:18
-
-
Save Chirimen-Jako/74991e905be20b93c0fcdeae553594d1 to your computer and use it in GitHub Desktop.
おっぱいそんちくびんびん♪ (Nim)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# おっぱい.nim | |
# | |
# 2019/08/19: initial release | |
# | |
# Ubuntu 18.04.2 LTS (Bionic Beaver) | |
# | |
# Nim Compiler Version 0.20.2 [Linux: amd64] | |
# Compiled at 2019-07-17 | |
# Copyright (c) 2006-2019 by Andreas Rumpf | |
# | |
# $ nim c -r -d:release おっぱい.nim | |
# | |
# Dedicated to shirasu | |
# https://gist.github.com/8q/a5331c6ef8a205b32125 | |
# | |
from random import randomize, shuffle | |
from sequtils import map | |
import sugar | |
from strutils import join | |
const RealStr: string = "おっぱいそんちくびんびん" | |
let OppaiElements = ["おっ", "ぱい", "そん", "ちく", "びん", "びん"] | |
randomize() | |
var testStr: string = "" | |
var count: int = 0 | |
while testStr != RealStr: | |
count += 1 | |
var numList: array[6, int] = [0, 1, 2, 3, 4, 5] | |
shuffle(numList) | |
testStr = numList.map(i => OppaiElements[i]).join | |
echo count, " ", testStr | |
stdout.write "おめでとうございます!", " " | |
stdout.write "あなたは", count, "回目に", RealStr, "しました。\n" | |
echo "end" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment