Emojify/main.cpp

57 lines
982 B
C++
Raw Normal View History

2018-11-14 15:03:31 -05:00
#include <iostream>
int main(int argc, char *argv[])
{
if(argc < 2)
{
std::cout << "You must provide SOMETHING." << std::endl;
return -1;
}
std::cout << ":large_blue_diamond: ";
for(auto i = 1; i < argc; ++i)
{
for(auto j = 0; argv[i][j] != '\0'; ++j)
2019-11-13 16:26:32 -05:00
{
switch(argv[i][j])
{
case 0:
std::cout << ":zero: ";
break;
case 1:
std::cout << ":one: ";
break;
case 2:
std::cout << ":two: ";
break;
case 3:
std::cout << ":three: ";
break;
case 4:
std::cout << ":four: ";
break;
case 5:
std::cout << ":five: ";
break;
case 6:
std::cout << ":six: ";
break;
case 7:
std::cout << ":seven: ";
break;
case 8:
std::cout << ":eight: ";
break;
case 9:
std::cout << ":nine: ";
break;
default:
std::cout << ":regional_indicator_" << char(std::tolower(argv[i][j])) << ": ";
break;
}
}
2018-11-14 15:03:31 -05:00
std::cout << ":large_blue_diamond: ";
}
std::cout << std::endl;
}