-
-
Save kureikei/b4b3cd3f7e10391c787e to your computer and use it in GitHub Desktop.
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
#include <complex> | |
#include <iostream> | |
#include <locale> | |
int main() | |
{ | |
auto const haiku = L"島々に 灯をともしけり春の海 正岡子規"; | |
std::complex<int> c(3, 0), cp(c); | |
std::complex<int> const r(-1, 0), i(0, 1); | |
std::ios_base::sync_with_stdio(false); | |
std::locale::global(std::locale("")); | |
std::wcout.imbue(std::locale("")); | |
for (auto a = 0; a < 21; a++, c += r) { | |
if (!c.real()) { | |
std::wcout << haiku[7 * c.real() + c.imag()] << std::endl; | |
cp += i; | |
c = cp; | |
} | |
std::wcout << haiku[7 * c.real() + c.imag()]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment