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 <stdio.h> | |
template <size_t N> | |
struct PrimeTable { | |
constexpr PrimeTable() : sieve() { | |
sieve[0] = sieve[1] = false; | |
for (size_t i = 2; i < N; i++) sieve[i] = true; | |
for (size_t i = 2; i < N; i++) { | |
if (sieve[i]) | |
for (size_t j = i*i; j < N; j += i) sieve[j] = false; |
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
// this de-obfuscated version by Davide Della Casa | |
// original obfuscated version by Yusuke Endoh | |
// modified for Windows (Mingw-w64) | |
// formatted in Chromium C/C++ style | |
// compile with gcc ascii-win.c -o ascii -O3 -s -flto | |
// usage and original repo see https://github.com/davidedc/Ascii-fluid-simulation-deobfuscated | |
#include <stdio.h> | |
#include <complex.h> | |
#include <math.h> |
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
/* std::lower_bound + hand-written move */ | |
void insert(Index x) { | |
auto it = std::lower_bound(begin(), end(), x); | |
if (it == end()) push_back(x); | |
else if (*it > x) { | |
Index i = it - begin(); | |
resize(size() + 1); | |
for (Index j = size() - 1; j > i; j--) { |
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
""" | |
Original raw text: | |
http://sherlock-holm.es/ascii/ | |
Trimmed Format: | |
- Each line is a complete paragraph. | |
- Each line is ended with two new line characters ('\n\n') (including the last line). | |
- Disclaimer at the end of the raw text is not deleted, you need to delete it yourself. | |
""" |