i made working c++ for once? wack
parent
64debd83a2
commit
a04f5f83bd
@ -1,2 +1,2 @@
|
||||
default:
|
||||
g++ -o factorio_terminal_game main.cpp
|
||||
g++ -o build/main src/main.cpp
|
||||
|
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
[Project]
|
||||
Manager=KDevCustomMakeManager
|
||||
Name=factorio_terminal_game
|
@ -1,7 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::cout << "Hello, world!" << std::endl;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
#include <iostream>
|
||||
#include <sys/ioctl.h>
|
||||
#include <string.h>
|
||||
|
||||
std::string filename = "main";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct winsize w;
|
||||
ioctl(0, TIOCGWINSZ, &w);
|
||||
|
||||
std::cout << w.ws_row << " lines\n";
|
||||
std::cout << w.ws_col << " columns\n";
|
||||
std::cout << argc << " arguments" << std::endl;
|
||||
if (argc==1) {
|
||||
std::cout << "no arguments :(" << std::endl;
|
||||
} else {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
char *arg = argv[i];
|
||||
|
||||
if (!strcmp(arg, "--help")) {
|
||||
std::cout << "this is a factorio clone that runs in the terminal. it is shit." << std::endl;
|
||||
std::cout << "syntax: " << filename << " [arguments] <*.json>" << std::endl;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue