Created
September 26, 2026 06:45
-
-
Save TangentMochi/4dec4e36cd3c6033fa46cb00bd07a87b to your computer and use it in GitHub Desktop.
エ駄死判定プログラム
This file contains hidden or 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
| /* | |
| * edashi.c | |
| * エッチな文章かそうでないかをコハルが判定するプログラム | |
| * | |
| * License: Do What The Fuck You Want To Public License | |
| * 実在の人物、団体、企業、団体名、商品名、ゲームなどとは一切関係ありません。 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <wchar.h> | |
| #include <locale.h> | |
| #define BUFFER_SIZE 4096 | |
| int main() { | |
| setlocale(LC_ALL, ""); | |
| char buffer[BUFFER_SIZE]; | |
| size_t inRead = 0; | |
| int isKoharu = 0; | |
| int isTty = isatty(fileno(stdin)); | |
| wint_t c = 0; | |
| if (isTty) { | |
| wprintf(L">> "); | |
| } | |
| while ((c = getwchar()) != WEOF) { | |
| if (c == L'H' || c == L'h' || c == L'え') { | |
| isKoharu = 1; | |
| wprintf(L"\033[31;5m%lc\033[0m", c); | |
| } else { | |
| wprintf(L"%lc", c); | |
| } | |
| if (isTty && (c == '\n' || c == '\r')) { | |
| break; | |
| } | |
| } | |
| wprintf(L"\n"); | |
| if (isKoharu) { | |
| wprintf(L"\n ꒰ঌ(⸝⸝ↀ□ↀ⸝⸝)໒꒱\033[38;2;128;32;64m「エッチなのはダメ!死刑!」\033[0m \n"); | |
| } else { | |
| wprintf(L"\nこれは大丈夫ね! \n"); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment