Skip to content

Instantly share code, notes, and snippets.

@jaredswarts55
Created August 18, 2023 16:16
Show Gist options
  • Select an option

  • Save jaredswarts55/99f0181253e2917ace170a650a9f6c70 to your computer and use it in GitHub Desktop.

Select an option

Save jaredswarts55/99f0181253e2917ace170a650a9f6c70 to your computer and use it in GitHub Desktop.
An Unobfuscated form of the emoji code
#include <iostream>
#include <string>
#include <vector>
#include <memory>
enum 🐿 {🐡, πŸ™ˆ, πŸ™‰, πŸ™Š};
int getRandom() { return std::rand(); }
bool getFalse() { return false; }
struct FoodBase { virtual void Execute() = 0; };
struct Peach : FoodBase { virtual void Execute() { std::cout << "πŸ‘" << std::endl; }; };
struct Watermelon : FoodBase { virtual void Execute() { std::cout << "πŸ‰" << std::endl; }; };
struct Cherry : FoodBase { virtual void Execute() { std::cout << "πŸ’" << std::endl; }; };
struct Strawberry : FoodBase { virtual void Execute() { std::cout << "πŸ“" << std::endl; }; };
struct Pineapple : FoodBase { virtual void Execute() { std::cout << "🍍" << std::endl; }; };
struct Tomato : FoodBase { virtual void Execute() { std::cout << "πŸ…" << std::endl; }; };
int main()
{
if (getFalse() == false)
std::cout << "πŸ’©" << std::endl;
std::vector<std::shared_ptr<FoodBase>> foods = {std::make_shared<Peach>(), std::make_shared<Watermelon>(), std::make_shared<Cherry>(), std::make_shared<Strawberry>(), std::make_shared<Pineapple>(), std::make_shared<Tomato>()};
for (auto food : foods)
food->Execute();
return getRandom();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment