Created
December 12, 2018 01:35
-
-
Save nbervar21/e2aef83c3d51902ba2cd1dccf34b305a to your computer and use it in GitHub Desktop.
caesar.c - emoji versions
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 version - passes check50 and style50 | |
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#define π int | |
#define π "Usage: ./caesar k\n" | |
#define π strlen | |
#define π΅ 0 | |
#define π 1 | |
#define π return | |
#define π’ 'A' | |
#define π 2 | |
#define π printf | |
#define π₯ isalpha | |
#define π» if | |
#define π£ 'a' | |
#define π 13 | |
#define π₯ "plaintext: " | |
#define π₯₯ 26 | |
#define π main | |
#define π₯ char | |
#define π for | |
#define π₯ "ciphertext: " | |
#define π atoi | |
#define π€ get_string | |
#define π΅ "%c" | |
#define π "\n" | |
π π(π π, π₯ *π[]) | |
{ | |
π»(π != π) | |
π(π(π) * π΅) + π; | |
π₯ *π = π€(π₯); | |
π(π₯); | |
π(π π = π΅, πͺ = π(π), π = π(π[π]); π < πͺ; | |
π += ((π(π΅, π₯(π[π]) ? (π[π] - ((π[π] - π’) % | |
(π£ - π’))) + ((((π[π] - π’) % (π£ - π’)) + π) % π₯₯) : π[π]) * π΅) + π)); | |
π(π); | |
} |
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
// caesar.c but its one line and also made using emojis | |
// i don't even want to accredit myself to this ππ« | |
#include <cs50.h> | |
#include <stdio.h> | |
#define π int | |
#define π "Usage: ./caesar k\n" | |
#define π΅ 0 | |
#define π 1 | |
#define π return | |
#define π’ 'A' | |
#define π 2 | |
#define π printf | |
#define π₯ isalpha | |
#define π» if | |
#define π£ 'a' | |
#define π 13 | |
#define π₯ "plaintext: " | |
#define π₯₯ INT_MAX | |
#define π main | |
#define π₯ char | |
#define π for | |
#define π₯ "ciphertext: " | |
#define π atoi | |
#define π€ get_string | |
#define π΅ "%c" | |
#define π "\n" | |
#define π© "" | |
#define π€· 26 | |
#define π 'Z' | |
#define π 'z' | |
#define π '\0' | |
#define π "%s%c%s" | |
π π(π π, π₯ *πͺ[]) | |
{ | |
π (π₯ π = ((π == π) ? π΅ : ((π(π) * π΅) + π₯₯)), *πΆ = (π == π) ? π€(π₯) : π©; πΆ[(π)π] != π; π += ((π)π == π₯₯) ? π΅ : ((π(π, (π < π) ? π₯ : π©, ((πΆ[(π)π] >= π’ && πΆ[(π)π] <= π) || (πΆ[(π)π] >= π£ && πΆ[(π)π] <= π)) ? (πΆ[(π)π] - ((πΆ[(π)π] - π’) % (π£ - π’))) + ((((πΆ[(π)π] - π’) % (π£ - π’)) + π(πͺ[π == π ? π : π΅])) % π€·) : πΆ[(π)π], (πΆ[(π)π + π] != π) ? π© : π) * π΅) + π)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment