From 696f82e18db271bd0b6a988190ede00bbab55d89 Mon Sep 17 00:00:00 2001 From: Pedro Lopes Date: Mon, 17 Oct 2022 22:08:18 -0300 Subject: [PATCH] Adiciona gabarito - TP02Q02 --- .../tp02/TP02Q02 - Registro em C/Linux_Game | Bin 0 -> 25888 bytes .../tp02/TP02Q02 - Registro em C/Linux_Game.c | 718 ++++++++++++++++++ .../tp02/TP02Q02 - Registro em C/WSL_Game | Bin 0 -> 25888 bytes .../tp02/TP02Q02 - Registro em C/WSL_Game.c | 718 ++++++++++++++++++ .../tp02/TP02Q02 - Registro em C/pedro.out | 50 ++ .../tp02/TP02Q02 - Registro em C/pub.in | 51 ++ .../tp02/TP02Q02 - Registro em C/pub.out | 50 ++ 7 files changed, 1587 insertions(+) create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/Linux_Game create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/Linux_Game.c create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game.c create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/pedro.out create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.in create mode 100644 tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.out diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/Linux_Game b/tps/gabaritos/tp02/TP02Q02 - Registro em C/Linux_Game new file mode 100644 index 0000000000000000000000000000000000000000..2170b62341e052fcd2501a651f5f22dcb64a015b GIT binary patch literal 25888 zcmeHQeRx#WnLm>c2nd;=rs5|fg(?CeARwVo6JWv(CV)aTE#NRD1DTqy&W8d54Gyu~ z9j0boY4O=UUHro>PrGfYtu4A`O@xwkAGN_{#VTE6tL;ofH3r=xg0sK(eB8PBW`?b; z`t*-Edgndw=XuY2KJGbZCWo)Ot1ELH4yIBr`vN1(b*Z3~OUC+jG6PV~=CQH(oWQPQ zBY@{|n&6iU0Io16oAS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index 0000000..575f5ac --- /dev/null +++ b/tps/gabaritos/tp02/TP02Q02 - Registro em C/Linux_Game.c @@ -0,0 +1,718 @@ +// -------------------------------------------------------------------------------- // + +// Includes +#include +#include +#include +#include +#include + +// -------------------------------------------------------------------------------- // + +// Definitions +#define MAX_GAMES 9000 +#define MAX_FIELD_SIZE 250 +#define MAX_STRING_ARRAY_SIZE 100 + +// -------------------------------------------------------------------------------- // + +// Structs +typedef struct { + + int year, + month; +} Date; + +typedef struct { + + char name[MAX_FIELD_SIZE], + owners[MAX_FIELD_SIZE], + website[MAX_FIELD_SIZE], + developers[MAX_FIELD_SIZE], + languages[MAX_STRING_ARRAY_SIZE][30], + genres[MAX_STRING_ARRAY_SIZE][30]; + + Date release_date; + int app_id, age, dlcs, avg_playtime, count_languages, count_genres; + float price, upvotes; + bool windows_os, mac_os, linux_os; + +} Game; + +// -------------------------------------------------------------------------------- // + +// Global variables +Game games[MAX_GAMES]; +int n = 0; + +// -------------------------------------------------------------------------------- // + +// Functions +bool isFim(char* line) { return line[0] == 'F' && line[1] == 'I' && line[2] == 'M'; } + +void substring(char *string, char *string_start, int length) { + + strncpy(string, string_start, length); + string[length] = '\0'; +} + +char *getMonthName(int month) { + + switch(month) { + + case 1: return "Jan"; break; + case 2: return "Feb"; break; + case 3: return "Mar"; break; + case 4: return "Apr"; break; + case 5: return "May"; break; + case 6: return "Jun"; break; + case 7: return "Jul"; break; + case 8: return "Aug"; break; + case 9: return "Sep"; break; + case 10: return "Oct"; break; + case 11: return "Nov"; break; + case 12: return "Dec"; break; + + default: return "N/A"; break; + } +} + +int getMonthNumber(char* month) { + + if(!strcmp(month, "Jan")) return 1; + else if(!strcmp(month, "Feb")) return 2; + else if(!strcmp(month, "Mar")) return 3; + else if(!strcmp(month, "Apr")) return 4; + else if(!strcmp(month, "May")) return 5; + else if(!strcmp(month, "Jun")) return 6; + else if(!strcmp(month, "Jul")) return 7; + else if(!strcmp(month, "Aug")) return 8; + else if(!strcmp(month, "Sep")) return 9; + else if(!strcmp(month, "Oct")) return 10; + else if(!strcmp(month, "Nov")) return 11; + else if(!strcmp(month, "Dec")) return 12; +} + +// -------------------------------------------------------------------------------- // + +// Class game functions +void game_start(Game *game) { + + strcpy(game -> name, ""); + strcpy(game -> owners, ""); + strcpy(game -> website, ""); + strcpy(game -> developers, ""); + + for(int i = 0; i < MAX_STRING_ARRAY_SIZE; i++) { + + strcpy(game -> languages[i], ""); + strcpy(game -> genres[i], ""); + } + + game -> release_date.month = -1; + game -> release_date.year = -1; + game -> app_id = -1; + game -> age = -1; + game -> dlcs = -1; + game -> avg_playtime = -1; + game -> price = -1; + game -> upvotes = -1; + game -> windows_os = false; + game -> mac_os = false; + game -> linux_os = false; + + game -> count_languages = 0; + game -> count_genres = 0; +} + +void game_print(Game *game) { + + int hours = game -> avg_playtime / 60, + minutes = game -> avg_playtime % 60; + + printf("%i %s %s/%04i %s %i %.2f %i [", game -> app_id, game -> name, getMonthName(game -> release_date.month), game -> release_date.year, game -> owners, game -> age, game -> price, game -> dlcs); + + for(int i = 0; i < game -> count_languages; i++) { + + printf("%s%s", game -> languages[i], i < game -> count_languages - 1 ? ", " : ""); + } + + printf("] %s %s %s %s ", game -> website, game -> windows_os ? "true" : "false", game -> mac_os ? "true" : "false", game -> linux_os ? "true" : "false"); + + if(isnan(game -> upvotes)) printf("0.0%% "); + else printf("%.0f%% ", game -> upvotes); + + if(hours > 0) + { + printf("%ih ", hours); + + if(minutes > 0) printf("%im ", minutes); + } + else { + + if(minutes > 0) printf("%im ", minutes); + else printf("null "); + } + + printf("%s [", game -> developers); + + for(int i = 0; i < game -> count_genres; i++) { + + printf("%s%s", game -> genres[i], i < game -> count_genres - 1 ? ", " : ""); + } + + printf("]\n"); +} + +Game game_clone(Game *game) { + + Game cloned; + + strcpy(cloned.name, game -> name); + strcpy(cloned.owners, game -> owners); + strcpy(cloned.website, game -> website); + strcpy(cloned.developers, game -> developers); + + for(int i = 0; i < game -> count_languages; i++) strcpy(cloned.languages[i], game -> languages[i]); + for(int i = 0; i < game -> count_genres; i++) strcpy(cloned.genres[i], game -> genres[i]); + + cloned.release_date.month = game -> release_date.month; + cloned.release_date.year = game -> release_date.year; + cloned.app_id = game -> app_id; + cloned.age = game -> age; + cloned.dlcs = game -> dlcs; + cloned.avg_playtime = game -> avg_playtime; + cloned.price = game -> price; + cloned.upvotes = game -> upvotes; + cloned.windows_os = game -> windows_os; + cloned.mac_os = game -> mac_os; + cloned.linux_os = game -> linux_os; + return cloned; +} + +void game_read(Game *game, char *line) { + + char c_search, sub[MAX_FIELD_SIZE]; + int index = 0, atr_index = 0; + + // ------------------------------------------------------------ // + + // Find "AppID" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> app_id = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Name" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> name, sub); + + if(c_search == ',') index++; + else if(c_search == '\"') index += 2; + + atr_index = index; + break; + } + } + } + else { + + strcpy(game -> name, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find release date + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + + char subDate[10]; + + substring(subDate, &sub[0], 3); + + game -> release_date.month = getMonthNumber(subDate); + + if(c_search == ',') { + + substring(subDate, &sub[4], 4); + + game -> release_date.year = atoi(subDate); + + index++; + } + else if(c_search == '\"') { + + int nmbSpace = 0; + + for(int i = 0; ; i++) { + + if(sub[i] == ' ') nmbSpace++; + + if(nmbSpace == 2) { + + i++; + + substring(subDate, &sub[i], 4); + + game -> release_date.year = atoi(subDate); + break; + } + } + + index += 2; + } + + atr_index = index; + break; + } + } + } + else { + + game -> release_date.month = 0; + game -> release_date.year = 0; + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Owners" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> owners, sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Age" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> age = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Price" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> price = atof(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "DLCs" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> dlcs = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Languages" + while(true) { + + index++; + + if(line[index] == ']') { + + index++; + + if(line[index] == ',') index++; + else if(line[index] == '\"') index += 2; + + atr_index = index; + break; + } + else if(line[index] == '\'') { + + int wordStart = index + 1; + + while(true) { + + index++; + + if(line[index] == '\'') { + + substring(sub, &line[wordStart], index - wordStart); + strcpy(game -> languages[game -> count_languages++], sub); + break; + } + } + } + } + + // ------------------------------------------------------------ // + + // Find "Website" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> website, sub); + + atr_index = ++index; + break; + } + } + } + else { + + strcpy(game -> website, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Windows" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> windows_os = true; + + atr_index = ++index; + break; + } + } + + // Find "Mac" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> mac_os = true; + + atr_index = ++index; + break; + } + } + + // Find "Linux" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> linux_os = true; + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Upvotes" + int positives, negatives; + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + positives = atoi(sub); + atr_index = ++index; + break; + } + } + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + negatives = atoi(sub); + atr_index = ++index; + break; + } + } + + game -> upvotes = (float)(positives * 100) / (float)(positives + negatives); + + // ------------------------------------------------------------ // + + // Find "AVG Playtime" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> avg_playtime = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Developers" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> developers, sub); + + atr_index = ++index; + break; + } + } + } + else { + + strcpy(game -> developers, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Genres" + if(index < strlen(line) - 1) { + + if(line[index] == ',') atr_index = ++index; + + if(line[atr_index] == '\"') { + + atr_index++; + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> genres[game -> count_genres++], sub); + + atr_index = ++index; + } + else if(line[index] == '\"') { + + substring(sub, &line[atr_index], strlen(line) - 1 - atr_index); + + if(sub[strlen(sub) - 1] == '\"') sub[strlen(sub) - 1] = '\0'; + else if(sub[strlen(sub) - 2] == '\"') sub[strlen(sub) - 2] = '\0'; + + strcpy(game -> genres[game -> count_genres++], sub); + break; + } + } + } + else { + + substring(sub, &line[atr_index], strlen(line) - 2 - atr_index); + + strcpy(game -> genres[game -> count_genres++], sub); + } + } +} + +// -------------------------------------------------------------------------------- // + +// Functions - List +void list_insert(Game x) { + + if(n >= MAX_GAMES) { + + printf("Insert error: MAX_GAMES reached"); + exit(1); + } + + games[n++] = x; +} + +// ---------------------------------------------------------------------------------------------------------- // + +int main() { + + // ------------------------------------------------------------ // + + // First part - Read all games + + // Open CSV file + FILE *fp; + char *line = NULL; + size_t len = 0; + size_t read; + + fp = fopen("/tmp/games.csv", "r"); + + if(fp == NULL) exit(EXIT_FAILURE); + + // ------------------------- // + + // Fill games list + while((read = getline(&line, &len, fp)) != -1) { + + Game game; + + game_start(&game); + game_read(&game, line); + list_insert(game); + } + + // ------------------------- // + + fclose(fp); + + if(line) free(line); + + // ------------------------------------------------------------ // + + // Second part - Print .in games + + char in[15]; + scanf(" %[^\n]s", in); + + while(true) { + + if(isFim(in)) break; + else { + + int app_id = atoi(in); + + for(int i = 0; i < n; i++) { + + if(games[i].app_id == app_id) { + + game_print(&games[i]); + break; + } + } + + // ------------------------- // + + scanf(" %[^\n]s", in); + } + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game b/tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game new file mode 100644 index 0000000000000000000000000000000000000000..1186c69a5dc750ce1f7b71537d65fdc0662e76df GIT binary patch literal 25888 zcmeHQe{@vUoxhVG5D+p!jYX+4Qc^`A1PYW`(F7QHu?a*Vnl0dDNCq-BzdAnCLANxH{sa9Pw!Ptn!wjG-EXb`inZ&-ea#^WMu0 zt!{Pu$6S5$z2Berd%yR`yZ6rI@(p+O@*IbQsg%oZW`wye6_g6eXxJb#02OQzn~2Y; z>>4%(cpj$-euV(wiu6*B6&6T(E+FYmrc4_6SwUtBDh~;gUZzw(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`I~cOzgZAYik~;YL|spo5jRwTFDAo7=*r9RbuT5ZY!UZ4CQy%d)>ok}8)}%?^1t zGcMlj4K}mVrfqE~LcmZ!aJKjYL4SLj1@V9v@U?hJLFPJILadaxKq<1No7;g>CWx;v zOGCb`Kxx!Nx}A61QeU$i=gm#9rZ8bc40xfT@+ivN>W49*jy7bam~2`xftY8lkDaF# ztpg9HXP(r4N+oPsVTD4|{d4$yJ!2EEpK+AqsjP?ayY`NnyO6lY#!=xjsjtMd;9&r)!a z$VbYm`m1vYKWJ2>(pURO1=aZpM0k?s6w1Da9Gy)leYMY25Z4s(r2JQM3ho4#&N>vX z_M-|`2=!6^OEQZgLorqQYTv40j}%np+w1=wslPmLA(VxsJ0 zu_BU$_8ptO{l9C|cS$`3?H%4`o;_;Um-}azgi2m|Wp|GqwCSt;w}Qh;Q9@-;!KZBc zYQ3l60(H=3(^qDnw&|<=yn+*zpoI4L{Zi_y_GcARP(qij!>aa^Qta2rkciS(=K~7v zRe}=Q%YVhDug(z^T%-(3eS7(DfKGdIIqZ%7vAWOSF0XI}-+`{vq_55;YHL75QgQ-I z;fj6%4C=e8e06@I{(T1Z?=Z+=Vc1jc|3m0f{FJ^r=g?Mxh;&E*<5QKZ;20>I^;v@y ztrbv}qYNlLh0|{&h^ESSH3&|T)bEk|MBJ literal 0 HcmV?d00001 diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game.c b/tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game.c new file mode 100644 index 0000000..6bba16e --- /dev/null +++ b/tps/gabaritos/tp02/TP02Q02 - Registro em C/WSL_Game.c @@ -0,0 +1,718 @@ +// -------------------------------------------------------------------------------- // + +// Includes +#include +#include +#include +#include +#include + +// -------------------------------------------------------------------------------- // + +// Definitions +#define MAX_GAMES 9000 +#define MAX_FIELD_SIZE 250 +#define MAX_STRING_ARRAY_SIZE 100 + +// -------------------------------------------------------------------------------- // + +// Structs +typedef struct { + + int year, + month; +} Date; + +typedef struct { + + char name[MAX_FIELD_SIZE], + owners[MAX_FIELD_SIZE], + website[MAX_FIELD_SIZE], + developers[MAX_FIELD_SIZE], + languages[MAX_STRING_ARRAY_SIZE][30], + genres[MAX_STRING_ARRAY_SIZE][30]; + + Date release_date; + int app_id, age, dlcs, avg_playtime, count_languages, count_genres; + float price, upvotes; + bool windows_os, mac_os, linux_os; + +} Game; + +// -------------------------------------------------------------------------------- // + +// Global variables +Game games[MAX_GAMES]; +int n = 0; + +// -------------------------------------------------------------------------------- // + +// Functions +bool isFim(char* line) { return line[0] == 'F' && line[1] == 'I' && line[2] == 'M'; } + +void substring(char *string, char *string_start, int length) { + + strncpy(string, string_start, length); + string[length] = '\0'; +} + +char *getMonthName(int month) { + + switch(month) { + + case 1: return "Jan"; break; + case 2: return "Feb"; break; + case 3: return "Mar"; break; + case 4: return "Apr"; break; + case 5: return "May"; break; + case 6: return "Jun"; break; + case 7: return "Jul"; break; + case 8: return "Aug"; break; + case 9: return "Sep"; break; + case 10: return "Oct"; break; + case 11: return "Nov"; break; + case 12: return "Dec"; break; + + default: return "N/A"; break; + } +} + +int getMonthNumber(char* month) { + + if(!strcmp(month, "Jan")) return 1; + else if(!strcmp(month, "Feb")) return 2; + else if(!strcmp(month, "Mar")) return 3; + else if(!strcmp(month, "Apr")) return 4; + else if(!strcmp(month, "May")) return 5; + else if(!strcmp(month, "Jun")) return 6; + else if(!strcmp(month, "Jul")) return 7; + else if(!strcmp(month, "Aug")) return 8; + else if(!strcmp(month, "Sep")) return 9; + else if(!strcmp(month, "Oct")) return 10; + else if(!strcmp(month, "Nov")) return 11; + else if(!strcmp(month, "Dec")) return 12; +} + +// -------------------------------------------------------------------------------- // + +// Class game functions +void game_start(Game *game) { + + strcpy(game -> name, ""); + strcpy(game -> owners, ""); + strcpy(game -> website, ""); + strcpy(game -> developers, ""); + + for(int i = 0; i < MAX_STRING_ARRAY_SIZE; i++) { + + strcpy(game -> languages[i], ""); + strcpy(game -> genres[i], ""); + } + + game -> release_date.month = -1; + game -> release_date.year = -1; + game -> app_id = -1; + game -> age = -1; + game -> dlcs = -1; + game -> avg_playtime = -1; + game -> price = -1; + game -> upvotes = -1; + game -> windows_os = false; + game -> mac_os = false; + game -> linux_os = false; + + game -> count_languages = 0; + game -> count_genres = 0; +} + +void game_print(Game *game) { + + int hours = game -> avg_playtime / 60, + minutes = game -> avg_playtime % 60; + + printf("%i %s %s/%04i %s %i %.2f %i [", game -> app_id, game -> name, getMonthName(game -> release_date.month), game -> release_date.year, game -> owners, game -> age, game -> price, game -> dlcs); + + for(int i = 0; i < game -> count_languages; i++) { + + printf("%s%s", game -> languages[i], i < game -> count_languages - 1 ? ", " : ""); + } + + printf("] %s %s %s %s ", game -> website, game -> windows_os ? "true" : "false", game -> mac_os ? "true" : "false", game -> linux_os ? "true" : "false"); + + if(isnan(game -> upvotes)) printf("0.0%% "); + else printf("%.0f%% ", game -> upvotes); + + if(hours > 0) + { + printf("%ih ", hours); + + if(minutes > 0) printf("%im ", minutes); + } + else { + + if(minutes > 0) printf("%im ", minutes); + else printf("null "); + } + + printf("%s [", game -> developers); + + for(int i = 0; i < game -> count_genres; i++) { + + printf("%s%s", game -> genres[i], i < game -> count_genres - 1 ? ", " : ""); + } + + printf("]\n"); +} + +Game game_clone(Game *game) { + + Game cloned; + + strcpy(cloned.name, game -> name); + strcpy(cloned.owners, game -> owners); + strcpy(cloned.website, game -> website); + strcpy(cloned.developers, game -> developers); + + for(int i = 0; i < game -> count_languages; i++) strcpy(cloned.languages[i], game -> languages[i]); + for(int i = 0; i < game -> count_genres; i++) strcpy(cloned.genres[i], game -> genres[i]); + + cloned.release_date.month = game -> release_date.month; + cloned.release_date.year = game -> release_date.year; + cloned.app_id = game -> app_id; + cloned.age = game -> age; + cloned.dlcs = game -> dlcs; + cloned.avg_playtime = game -> avg_playtime; + cloned.price = game -> price; + cloned.upvotes = game -> upvotes; + cloned.windows_os = game -> windows_os; + cloned.mac_os = game -> mac_os; + cloned.linux_os = game -> linux_os; + return cloned; +} + +void game_read(Game *game, char *line) { + + char c_search, sub[MAX_FIELD_SIZE]; + int index = 0, atr_index = 0; + + // ------------------------------------------------------------ // + + // Find "AppID" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> app_id = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Name" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> name, sub); + + if(c_search == ',') index++; + else if(c_search == '\"') index += 2; + + atr_index = index; + break; + } + } + } + else { + + strcpy(game -> name, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find release date + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + + char subDate[10]; + + substring(subDate, &sub[0], 3); + + game -> release_date.month = getMonthNumber(subDate); + + if(c_search == ',') { + + substring(subDate, &sub[4], 4); + + game -> release_date.year = atoi(subDate); + + index++; + } + else if(c_search == '\"') { + + int nmbSpace = 0; + + for(int i = 0; ; i++) { + + if(sub[i] == ' ') nmbSpace++; + + if(nmbSpace == 2) { + + i++; + + substring(subDate, &sub[i], 4); + + game -> release_date.year = atoi(subDate); + break; + } + } + + index += 2; + } + + atr_index = index; + break; + } + } + } + else { + + game -> release_date.month = 0; + game -> release_date.year = 0; + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Owners" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> owners, sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Age" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> age = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Price" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> price = atof(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "DLCs" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> dlcs = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Languages" + while(true) { + + index++; + + if(line[index] == ']') { + + index++; + + if(line[index] == ',') index++; + else if(line[index] == '\"') index += 2; + + atr_index = index; + break; + } + else if(line[index] == '\'') { + + int wordStart = index + 1; + + while(true) { + + index++; + + if(line[index] == '\'') { + + substring(sub, &line[wordStart], index - wordStart); + strcpy(game -> languages[game -> count_languages++], sub); + break; + } + } + } + } + + // ------------------------------------------------------------ // + + // Find "Website" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> website, sub); + + atr_index = ++index; + break; + } + } + } + else { + + strcpy(game -> website, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Windows" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> windows_os = true; + + atr_index = ++index; + break; + } + } + + // Find "Mac" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> mac_os = true; + + atr_index = ++index; + break; + } + } + + // Find "Linux" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + if(!strcmp(sub, "True")) game -> linux_os = true; + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Upvotes" + int positives, negatives; + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + positives = atoi(sub); + atr_index = ++index; + break; + } + } + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + negatives = atoi(sub); + atr_index = ++index; + break; + } + } + + game -> upvotes = (float)(positives * 100) / (float)(positives + negatives); + + // ------------------------------------------------------------ // + + // Find "AVG Playtime" + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + + game -> avg_playtime = atoi(sub); + + atr_index = ++index; + break; + } + } + + // ------------------------------------------------------------ // + + // Find "Developers" + if(line[atr_index] != ',') { + + if(line[atr_index] == '\"') { + + atr_index++; + c_search = '\"'; + } + else c_search = ','; + + while(true) { + + index++; + + if(line[index] == c_search) { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> developers, sub); + + atr_index = ++index; + break; + } + } + } + else { + + strcpy(game -> developers, "null"); + + atr_index = ++index; + } + + // ------------------------------------------------------------ // + + // Find "Genres" + if(index < strlen(line) - 1) { + + if(line[index] == ',') atr_index = ++index; + + if(line[atr_index] == '\"') { + + atr_index++; + + while(true) { + + index++; + + if(line[index] == ',') { + + substring(sub, &line[atr_index], index - atr_index); + strcpy(game -> genres[game -> count_genres++], sub); + + atr_index = ++index; + } + else if(line[index] == '\"') { + + substring(sub, &line[atr_index], strlen(line) - 1 - atr_index); + + if(sub[strlen(sub) - 1] == '\"') sub[strlen(sub) - 1] = '\0'; + else if(sub[strlen(sub) - 2] == '\"') sub[strlen(sub) - 2] = '\0'; + + strcpy(game -> genres[game -> count_genres++], sub); + break; + } + } + } + else { + + substring(sub, &line[atr_index], strlen(line) - 1 - atr_index); + + strcpy(game -> genres[game -> count_genres++], sub); + } + } +} + +// -------------------------------------------------------------------------------- // + +// Functions - List +void list_insert(Game x) { + + if(n >= MAX_GAMES) { + + printf("Insert error: MAX_GAMES reached"); + exit(1); + } + + games[n++] = x; +} + +// ---------------------------------------------------------------------------------------------------------- // + +int main() { + + // ------------------------------------------------------------ // + + // First part - Read all games + + // Open CSV file + FILE *fp; + char *line = NULL; + size_t len = 0; + ssize_t read; + + fp = fopen("/tmp/games.csv", "r"); + + if(fp == NULL) exit(EXIT_FAILURE); + + // ------------------------- // + + // Fill games list + while((read = getline(&line, &len, fp)) != -1) { + + Game game; + + game_start(&game); + game_read(&game, line); + list_insert(game); + } + + // ------------------------- // + + fclose(fp); + + if(line) free(line); + + // ------------------------------------------------------------ // + + // Second part - Print .in games + + char in[15]; + scanf(" %[^\n]s", in); + + while(true) { + + if(isFim(in)) break; + else { + + int app_id = atoi(in); + + for(int i = 0; i < n; i++) { + + if(games[i].app_id == app_id) { + + game_print(&games[i]); + break; + } + } + + // ------------------------- // + + scanf(" %[^\n]s", in); + } + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/pedro.out b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pedro.out new file mode 100644 index 0000000..929980c --- /dev/null +++ b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pedro.out @@ -0,0 +1,50 @@ +840010 Garden Paws Dec/2018 50000 - 100000 0 19.99 2 [English] http://www.gardenpawsgame.com true true false 92% 5h 46m Bitten Toast Games Inc. [Adventure, Indie, RPG, Simulation] +866510 !AnyWay! Jun/2018 50000 - 100000 0 1.79 37 [English, Russian, French, Italian, German, Polish, Ukrainian, Swedish, Simplified Chinese] null true false false 69% 5h 53m EYEFRONT [Adventure, Casual, Indie] +1970560 Bobbi Adventure May/2022 50000 - 100000 0 24.99 0 [English] null true false false 67% null Felio Stung ROG [Indie] +411740 Yet Another World Nov/2015 50000 - 100000 0 5.99 0 [English] null true true true 78% 6h 24m Energy Milk [Action, Adventure, Indie] +1509590 Fujiwara Bittersweet Jan/2021 50000 - 100000 0 0.00 0 [English] null true true true 91% null MagicBenchVN [Free to Play, Indie] +458520 Wrath of Anna Apr/2018 50000 - 100000 0 19.99 1 [English, Spanish - Spain, Hungarian, German, Norwegian, Polish, Swedish, Russian] http://LorenzoEnt.com true false false 35% 2h 50m Lorenzo Ent.,Michael L. Fiorentino Gutierrez [Action, Adventure, Indie] +920210 LEGO® Star Wars™: The Skywalker Saga Apr/2022 500000 - 1000000 0 49.99 8 [English, French, Italian, German, Spanish - Spain, Arabic, Danish, Dutch, Korean, Polish, Portuguese - Brazil, Russian, Spanish - Latin America, Traditional Chinese, Japanese] null true false false 92% 22h 42m TT Games [Action, Adventure] +1444020 Reactor Tech² Aug/2021 50000 - 100000 0 14.99 0 [English, Russian] null true false false 68% null 4Co [Indie, Simulation, Strategy] +1232460 Onee Chanbara ORIGIN Oct/2020 50000 - 100000 18 59.99 96 [English, Simplified Chinese, Traditional Chinese, Japanese, Korean] null true false false 72% 2h 25m Tamsoft [Action] +2026070 Tank Commander: Battlefield Jul/2022 50000 - 100000 0 2.99 0 [English] null true false false 100% null SP GAMES [Action, Indie, Simulation] +258880 Professional Farmer 2014 Nov/2013 50000 - 100000 0 2.99 2 [English, French, Italian, German, Spanish - Spain, Polish, Russian, Dutch, Swedish, Norwegian] http://www.professional-farmer.com/ true false false 46% 32h 9m PlayWay S.A. [Simulation] +295250 Stranded May/2014 50000 - 100000 0 0.49 0 [English] null true true true 35% 3h 56m Peter Moorhead [Adventure, Indie] +299500 International Snooker May/2014 50000 - 100000 0 5.99 0 [English] http://www.bigheadgames.co.uk/ true false false 62% 1h 11m Big Head Games Ltd [Casual, Sports] +574080 Fog of War Jun/2018 50000 - 100000 0 4.99 1 [English, Russian] null true false false 48% 6h 14m Monkeys Lab. [Action, Indie, Massively Multiplayer, RPG, Simulation, Strategy] +598780 Boreal Blade Nov/2020 50000 - 100000 0 3.99 0 [English, French, Italian, German, Spanish - Spain, Japanese, Korean, Portuguese - Brazil, Russian, Simplified Chinese] https://www.borealblade.com true false false 66% null Frozenbyte [Action, Early Access] +1217190 浮世万千之前世今生 Jan/2020 50000 - 100000 0 5.49 1 [Simplified Chinese] null true false false 78% null 飞天大胖喵 [Adventure, Casual, Indie, RPG, Strategy] +257730 Infinity Wars: Animated Trading Card Game Sep/2014 500000 - 1000000 0 0.00 0 [English, Simplified Chinese] http://www.infinitywarsgame.com true false false 77% 6h 24m Lightmare Studios [Indie, Massively Multiplayer, Strategy] +1807730 Lab Bio-Terror Dec/2021 50000 - 100000 0 12.99 0 [English] null true false false 82% null VOLTECH [Action, Indie] +773670 Delete Jan/2018 50000 - 100000 0 1.99 0 [English, French, Italian, German, Spanish - Spain, Danish, Ukrainian, Russian, Bulgarian, Hungarian, Turkish, Greek, Norwegian, Czech, Japanese, Polish, Thai, Swedish, Simplified Chinese, Traditional Chinese, Romanian, Finnish, Dutch, Portuguese, Portuguese - Brazil, Arabic, Korean] null true true false 96% 1h 24m PONY [Casual, Indie] +1803150 Void Slayer Jan/2022 50000 - 100000 0 4.99 0 [English] null true false false 79% null Madmind Studio: After hours [Action, Indie] +1573070 Endless Furry Blackjack Mar/2021 50000 - 100000 0 0.99 0 [English] https://m.youtube.com/ericyoungvfx/ true false false 20% null Tegridy Made Games [Casual, Indie, Sports, Strategy] +513930 J.U.R : Japan Underground Racing Aug/2016 50000 - 100000 0 0.49 0 [English] null true false false 32% null JDM4iK [Casual, Indie, Racing, Simulation] +385250 Paint it Back Oct/2015 50000 - 100000 0 7.99 0 [English] http://casuallabs.com/wp/?page_id=24 true true true 98% null Casual Labs [Casual] +261880 Corporate Lifestyle Simulator Mar/2014 50000 - 100000 0 4.99 1 [English] http://www.dolphinbarn.com true false false 83% 4h 7m DolphinBarn [Action, Casual, Indie] +533300 Zup! Oct/2016 500000 - 1000000 0 0.99 1 [English, French, Italian, German, Spanish - Spain, Arabic, Bulgarian, Portuguese - Brazil, Hungarian, Greek, Danish, Traditional Chinese, Simplified Chinese, Korean, Dutch, Norwegian, Polish, Portuguese, Romanian, Russian, Thai, Turkish, Ukrainian, Finnish, Czech, Swedish, Japanese] http://quietriver.info/ true false false 94% 1h 42m Quiet River [Casual, Indie] +542340 Slingshot people Oct/2016 500000 - 1000000 0 0.99 0 [English] http://www.vsemagy.ru/index.php true false false 47% 3h 50m StalkerAlex [Action, Casual, Indie, Simulation] +1209040 Cyber Hunter Jun/2020 500000 - 1000000 0 0.00 0 [English, French, German, Spanish - Spain, Russian, Japanese, Simplified Chinese, Traditional Chinese, Portuguese - Brazil, Korean, Thai, Vietnamese] https://www.cyberhunter.game/ true false false 73% 5h 41m NetEase Games [Action, Free to Play, Massively Multiplayer] +8790 GTR 2 FIA GT Racing Game Dec/2012 50000 - 100000 0 7.99 0 [English] http://www.simbin.com/games/gtr2/ true false false 93% 11m SimBin Studios AB [Racing, Simulation, Sports] +8000 Tomb Raider: Anniversary Jun/2007 500000 - 1000000 13 8.99 0 [English, French, German, Italian, Spanish - Spain] http://www.tombraider.com/anniversary/ true false false 82% 6h Crystal Dynamics [Action, Adventure] +415150 Pang Adventures Apr/2016 50000 - 100000 0 9.99 0 [English, French, Italian, German, Spanish - Spain, Portuguese - Brazil, Russian] https://www.facebook.com/Pang.Adventures/ true false false 80% 3h 29m Dotemu [Action, Casual, Strategy] +2012500 The Katydids Incident Jun/2022 50000 - 100000 0 4.99 0 [English] https://punxstudios.co true false false 100% null Punx Studios [Indie, Simulation] +691150 Saku Saku: Love Blooms with the Cherry Blossoms Oct/2017 50000 - 100000 0 19.99 0 [English] null true false false 92% 5h 16m PALETTE [Sexual Content, Nudity, Casual] +283370 Marine Sharpshooter II: Jungle Warfare Apr/2014 50000 - 100000 0 2.99 0 [English] http://www.funboxmedia.co.uk/ true false false 32% 2h 3m Jarhead Games [Action] +249650 Blackguards Jan/2014 500000 - 1000000 0 0.99 2 [English, German, French, Spanish - Spain, Portuguese - Brazil, Russian, Italian, Japanese, Korean, Czech, Turkish, Polish, Simplified Chinese] http://www.blackguards-game.com true false false 62% 8h 58m Daedalic Entertainment [Indie, RPG, Strategy] +268870 Satellite Reign Aug/2015 500000 - 1000000 0 29.99 3 [English, French, Italian, German, Spanish - Spain, Czech, Russian] http://www.satellitereign.com/ true true true 71% 5h 18m 5 Lives Studios [Action, Indie, Strategy] +1172510 Unlock The King Nov/2019 50000 - 100000 0 0.99 0 [English] null true true false 96% null Minimol Games [Casual, Strategy] +927890 Hentai Girl Linda Dec/2018 50000 - 100000 0 0.99 0 [English, French, Italian, German, Spanish - Spain, Danish, Ukrainian, Russian, Bulgarian, Hungarian, Turkish, Greek, Norwegian, Czech, Japanese, Polish, Thai, Swedish, Simplified Chinese, Traditional Chinese, Romanian, Finnish, Dutch, Portuguese, Portuguese - Brazil, Arabic, Korean, Spanish - Latin America, Vietnamese] null true true false 94% 1h 13m GirlGames [Casual, Indie, RPG, Simulation] +25700 Madballs in Babo:Invasion Sep/2009 50000 - 100000 0 4.99 7 [English, German, Korean, Portuguese, Spanish - Spain, French, Italian, Russian] http://www.baboinvasion.com true true false 84% 4h 15m Playbrains [Action, Casual, Indie] +281610 Homeworld: Deserts of Kharak Jan/2016 500000 - 1000000 0 49.99 4 [English, French, Italian, German, Spanish - Spain, Russian, Polish] http://www.desertsofkharak.com true true false 83% 8h 32m Blackbird Interactive [Strategy] +485610 Ball 3D: Soccer Online Mar/2017 500000 - 1000000 0 9.99 0 [English] http://www.ball3d.com true true false 83% 2h 49m Unusualsoft [Sports] +1276850 Kane's Shadow Apr/2020 50000 - 100000 0 0.00 0 [English] null true true false 67% null Plush Productions LLC [Casual, Indie] +722340 Captain vs Sky Pirates Oct/2017 50000 - 100000 0 2.99 5 [English] https://store.steampowered.com/publisher/boogygames/ true false false 25% null Boogygames Studios [Action, Adventure, Indie, Strategy] +1499640 Y.E.T.I Jan/2021 50000 - 100000 0 0.49 0 [English] https://anpa.us true false false 80% null Racing Bros [Action, Indie] +1848450 Nightmare of Decay May/2022 50000 - 100000 0 3.99 0 [English, French, Polish, Russian, Simplified Chinese, Traditional Chinese, Spanish - Latin America, Portuguese - Brazil, Italian, German, Czech, Hungarian, Turkish, Norwegian, Swedish] null true false false 98% 5h 56m Checkmaty [Action, Adventure, Indie] +615700 A Plunge into Darkness Mar/2020 50000 - 100000 0 5.99 1 [English] https://www.aldorlea.org/ true false false 73% null Aldorlea [Adventure, Indie, RPG, Simulation, Strategy] +744980 Super Club Soccer Oct/2019 50000 - 100000 0 0.00 0 [English] http://www.superclubsoccer.com/ true false true 69% null Trick27 Studios Limited [Free to Play, Massively Multiplayer, Sports, Early Access] +10180 Call of Duty®: Modern Warfare® 2 (2009) Nov/2009 5000000 - 10000000 0 19.99 2 [English, French, German, Italian, Spanish - Spain] https://www.callofduty.com/ true true false 93% 12h 56m Infinity Ward [Action] +234390 Teleglitch: Die More Edition Jul/2013 500000 - 1000000 0 3.24 1 [English] http://www.teleglitch.com true true true 85% 2h 20m Test3 Projects [Action, Indie] +1641670 EdgeOfTheAbyssAwaken Jun/2022 50000 - 100000 0 18.99 3 [English, Simplified Chinese] null true false false 74% null TrinityBJ [Action, Indie, RPG, Strategy] +427520 Factorio Aug/2020 5000000 - 10000000 0 30.00 1 [English, French, Italian, German, Spanish - Spain, Hungarian, Dutch, Norwegian, Polish, Portuguese, Portuguese - Brazil, Romanian, Finnish, Swedish, Czech, Russian, Ukrainian, Japanese, Simplified Chinese, Traditional Chinese, Korean, Turkish] https://www.factorio.com true true true 97% 89h 43m Wube Software LTD. [Casual, Indie, Simulation, Strategy] diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.in b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.in new file mode 100644 index 0000000..cf004e0 --- /dev/null +++ b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.in @@ -0,0 +1,51 @@ +840010 +866510 +1970560 +411740 +1509590 +458520 +920210 +1444020 +1232460 +2026070 +258880 +295250 +299500 +574080 +598780 +1217190 +257730 +1807730 +773670 +1803150 +1573070 +513930 +385250 +261880 +533300 +542340 +1209040 +8790 +8000 +415150 +2012500 +691150 +283370 +249650 +268870 +1172510 +927890 +25700 +281610 +485610 +1276850 +722340 +1499640 +1848450 +615700 +744980 +10180 +234390 +1641670 +427520 +FIM diff --git a/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.out b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.out new file mode 100644 index 0000000..929980c --- /dev/null +++ b/tps/gabaritos/tp02/TP02Q02 - Registro em C/pub.out @@ -0,0 +1,50 @@ +840010 Garden Paws Dec/2018 50000 - 100000 0 19.99 2 [English] http://www.gardenpawsgame.com true true false 92% 5h 46m Bitten Toast Games Inc. [Adventure, Indie, RPG, Simulation] +866510 !AnyWay! Jun/2018 50000 - 100000 0 1.79 37 [English, Russian, French, Italian, German, Polish, Ukrainian, Swedish, Simplified Chinese] null true false false 69% 5h 53m EYEFRONT [Adventure, Casual, Indie] +1970560 Bobbi Adventure May/2022 50000 - 100000 0 24.99 0 [English] null true false false 67% null Felio Stung ROG [Indie] +411740 Yet Another World Nov/2015 50000 - 100000 0 5.99 0 [English] null true true true 78% 6h 24m Energy Milk [Action, Adventure, Indie] +1509590 Fujiwara Bittersweet Jan/2021 50000 - 100000 0 0.00 0 [English] null true true true 91% null MagicBenchVN [Free to Play, Indie] +458520 Wrath of Anna Apr/2018 50000 - 100000 0 19.99 1 [English, Spanish - Spain, Hungarian, German, Norwegian, Polish, Swedish, Russian] http://LorenzoEnt.com true false false 35% 2h 50m Lorenzo Ent.,Michael L. Fiorentino Gutierrez [Action, Adventure, Indie] +920210 LEGO® Star Wars™: The Skywalker Saga Apr/2022 500000 - 1000000 0 49.99 8 [English, French, Italian, German, Spanish - Spain, Arabic, Danish, Dutch, Korean, Polish, Portuguese - Brazil, Russian, Spanish - Latin America, Traditional Chinese, Japanese] null true false false 92% 22h 42m TT Games [Action, Adventure] +1444020 Reactor Tech² Aug/2021 50000 - 100000 0 14.99 0 [English, Russian] null true false false 68% null 4Co [Indie, Simulation, Strategy] +1232460 Onee Chanbara ORIGIN Oct/2020 50000 - 100000 18 59.99 96 [English, Simplified Chinese, Traditional Chinese, Japanese, Korean] null true false false 72% 2h 25m Tamsoft [Action] +2026070 Tank Commander: Battlefield Jul/2022 50000 - 100000 0 2.99 0 [English] null true false false 100% null SP GAMES [Action, Indie, Simulation] +258880 Professional Farmer 2014 Nov/2013 50000 - 100000 0 2.99 2 [English, French, Italian, German, Spanish - Spain, Polish, Russian, Dutch, Swedish, Norwegian] http://www.professional-farmer.com/ true false false 46% 32h 9m PlayWay S.A. [Simulation] +295250 Stranded May/2014 50000 - 100000 0 0.49 0 [English] null true true true 35% 3h 56m Peter Moorhead [Adventure, Indie] +299500 International Snooker May/2014 50000 - 100000 0 5.99 0 [English] http://www.bigheadgames.co.uk/ true false false 62% 1h 11m Big Head Games Ltd [Casual, Sports] +574080 Fog of War Jun/2018 50000 - 100000 0 4.99 1 [English, Russian] null true false false 48% 6h 14m Monkeys Lab. [Action, Indie, Massively Multiplayer, RPG, Simulation, Strategy] +598780 Boreal Blade Nov/2020 50000 - 100000 0 3.99 0 [English, French, Italian, German, Spanish - Spain, Japanese, Korean, Portuguese - Brazil, Russian, Simplified Chinese] https://www.borealblade.com true false false 66% null Frozenbyte [Action, Early Access] +1217190 浮世万千之前世今生 Jan/2020 50000 - 100000 0 5.49 1 [Simplified Chinese] null true false false 78% null 飞天大胖喵 [Adventure, Casual, Indie, RPG, Strategy] +257730 Infinity Wars: Animated Trading Card Game Sep/2014 500000 - 1000000 0 0.00 0 [English, Simplified Chinese] http://www.infinitywarsgame.com true false false 77% 6h 24m Lightmare Studios [Indie, Massively Multiplayer, Strategy] +1807730 Lab Bio-Terror Dec/2021 50000 - 100000 0 12.99 0 [English] null true false false 82% null VOLTECH [Action, Indie] +773670 Delete Jan/2018 50000 - 100000 0 1.99 0 [English, French, Italian, German, Spanish - Spain, Danish, Ukrainian, Russian, Bulgarian, Hungarian, Turkish, Greek, Norwegian, Czech, Japanese, Polish, Thai, Swedish, Simplified Chinese, Traditional Chinese, Romanian, Finnish, Dutch, Portuguese, Portuguese - Brazil, Arabic, Korean] null true true false 96% 1h 24m PONY [Casual, Indie] +1803150 Void Slayer Jan/2022 50000 - 100000 0 4.99 0 [English] null true false false 79% null Madmind Studio: After hours [Action, Indie] +1573070 Endless Furry Blackjack Mar/2021 50000 - 100000 0 0.99 0 [English] https://m.youtube.com/ericyoungvfx/ true false false 20% null Tegridy Made Games [Casual, Indie, Sports, Strategy] +513930 J.U.R : Japan Underground Racing Aug/2016 50000 - 100000 0 0.49 0 [English] null true false false 32% null JDM4iK [Casual, Indie, Racing, Simulation] +385250 Paint it Back Oct/2015 50000 - 100000 0 7.99 0 [English] http://casuallabs.com/wp/?page_id=24 true true true 98% null Casual Labs [Casual] +261880 Corporate Lifestyle Simulator Mar/2014 50000 - 100000 0 4.99 1 [English] http://www.dolphinbarn.com true false false 83% 4h 7m DolphinBarn [Action, Casual, Indie] +533300 Zup! Oct/2016 500000 - 1000000 0 0.99 1 [English, French, Italian, German, Spanish - Spain, Arabic, Bulgarian, Portuguese - Brazil, Hungarian, Greek, Danish, Traditional Chinese, Simplified Chinese, Korean, Dutch, Norwegian, Polish, Portuguese, Romanian, Russian, Thai, Turkish, Ukrainian, Finnish, Czech, Swedish, Japanese] http://quietriver.info/ true false false 94% 1h 42m Quiet River [Casual, Indie] +542340 Slingshot people Oct/2016 500000 - 1000000 0 0.99 0 [English] http://www.vsemagy.ru/index.php true false false 47% 3h 50m StalkerAlex [Action, Casual, Indie, Simulation] +1209040 Cyber Hunter Jun/2020 500000 - 1000000 0 0.00 0 [English, French, German, Spanish - Spain, Russian, Japanese, Simplified Chinese, Traditional Chinese, Portuguese - Brazil, Korean, Thai, Vietnamese] https://www.cyberhunter.game/ true false false 73% 5h 41m NetEase Games [Action, Free to Play, Massively Multiplayer] +8790 GTR 2 FIA GT Racing Game Dec/2012 50000 - 100000 0 7.99 0 [English] http://www.simbin.com/games/gtr2/ true false false 93% 11m SimBin Studios AB [Racing, Simulation, Sports] +8000 Tomb Raider: Anniversary Jun/2007 500000 - 1000000 13 8.99 0 [English, French, German, Italian, Spanish - Spain] http://www.tombraider.com/anniversary/ true false false 82% 6h Crystal Dynamics [Action, Adventure] +415150 Pang Adventures Apr/2016 50000 - 100000 0 9.99 0 [English, French, Italian, German, Spanish - Spain, Portuguese - Brazil, Russian] https://www.facebook.com/Pang.Adventures/ true false false 80% 3h 29m Dotemu [Action, Casual, Strategy] +2012500 The Katydids Incident Jun/2022 50000 - 100000 0 4.99 0 [English] https://punxstudios.co true false false 100% null Punx Studios [Indie, Simulation] +691150 Saku Saku: Love Blooms with the Cherry Blossoms Oct/2017 50000 - 100000 0 19.99 0 [English] null true false false 92% 5h 16m PALETTE [Sexual Content, Nudity, Casual] +283370 Marine Sharpshooter II: Jungle Warfare Apr/2014 50000 - 100000 0 2.99 0 [English] http://www.funboxmedia.co.uk/ true false false 32% 2h 3m Jarhead Games [Action] +249650 Blackguards Jan/2014 500000 - 1000000 0 0.99 2 [English, German, French, Spanish - Spain, Portuguese - Brazil, Russian, Italian, Japanese, Korean, Czech, Turkish, Polish, Simplified Chinese] http://www.blackguards-game.com true false false 62% 8h 58m Daedalic Entertainment [Indie, RPG, Strategy] +268870 Satellite Reign Aug/2015 500000 - 1000000 0 29.99 3 [English, French, Italian, German, Spanish - Spain, Czech, Russian] http://www.satellitereign.com/ true true true 71% 5h 18m 5 Lives Studios [Action, Indie, Strategy] +1172510 Unlock The King Nov/2019 50000 - 100000 0 0.99 0 [English] null true true false 96% null Minimol Games [Casual, Strategy] +927890 Hentai Girl Linda Dec/2018 50000 - 100000 0 0.99 0 [English, French, Italian, German, Spanish - Spain, Danish, Ukrainian, Russian, Bulgarian, Hungarian, Turkish, Greek, Norwegian, Czech, Japanese, Polish, Thai, Swedish, Simplified Chinese, Traditional Chinese, Romanian, Finnish, Dutch, Portuguese, Portuguese - Brazil, Arabic, Korean, Spanish - Latin America, Vietnamese] null true true false 94% 1h 13m GirlGames [Casual, Indie, RPG, Simulation] +25700 Madballs in Babo:Invasion Sep/2009 50000 - 100000 0 4.99 7 [English, German, Korean, Portuguese, Spanish - Spain, French, Italian, Russian] http://www.baboinvasion.com true true false 84% 4h 15m Playbrains [Action, Casual, Indie] +281610 Homeworld: Deserts of Kharak Jan/2016 500000 - 1000000 0 49.99 4 [English, French, Italian, German, Spanish - Spain, Russian, Polish] http://www.desertsofkharak.com true true false 83% 8h 32m Blackbird Interactive [Strategy] +485610 Ball 3D: Soccer Online Mar/2017 500000 - 1000000 0 9.99 0 [English] http://www.ball3d.com true true false 83% 2h 49m Unusualsoft [Sports] +1276850 Kane's Shadow Apr/2020 50000 - 100000 0 0.00 0 [English] null true true false 67% null Plush Productions LLC [Casual, Indie] +722340 Captain vs Sky Pirates Oct/2017 50000 - 100000 0 2.99 5 [English] https://store.steampowered.com/publisher/boogygames/ true false false 25% null Boogygames Studios [Action, Adventure, Indie, Strategy] +1499640 Y.E.T.I Jan/2021 50000 - 100000 0 0.49 0 [English] https://anpa.us true false false 80% null Racing Bros [Action, Indie] +1848450 Nightmare of Decay May/2022 50000 - 100000 0 3.99 0 [English, French, Polish, Russian, Simplified Chinese, Traditional Chinese, Spanish - Latin America, Portuguese - Brazil, Italian, German, Czech, Hungarian, Turkish, Norwegian, Swedish] null true false false 98% 5h 56m Checkmaty [Action, Adventure, Indie] +615700 A Plunge into Darkness Mar/2020 50000 - 100000 0 5.99 1 [English] https://www.aldorlea.org/ true false false 73% null Aldorlea [Adventure, Indie, RPG, Simulation, Strategy] +744980 Super Club Soccer Oct/2019 50000 - 100000 0 0.00 0 [English] http://www.superclubsoccer.com/ true false true 69% null Trick27 Studios Limited [Free to Play, Massively Multiplayer, Sports, Early Access] +10180 Call of Duty®: Modern Warfare® 2 (2009) Nov/2009 5000000 - 10000000 0 19.99 2 [English, French, German, Italian, Spanish - Spain] https://www.callofduty.com/ true true false 93% 12h 56m Infinity Ward [Action] +234390 Teleglitch: Die More Edition Jul/2013 500000 - 1000000 0 3.24 1 [English] http://www.teleglitch.com true true true 85% 2h 20m Test3 Projects [Action, Indie] +1641670 EdgeOfTheAbyssAwaken Jun/2022 50000 - 100000 0 18.99 3 [English, Simplified Chinese] null true false false 74% null TrinityBJ [Action, Indie, RPG, Strategy] +427520 Factorio Aug/2020 5000000 - 10000000 0 30.00 1 [English, French, Italian, German, Spanish - Spain, Hungarian, Dutch, Norwegian, Polish, Portuguese, Portuguese - Brazil, Romanian, Finnish, Swedish, Czech, Russian, Ukrainian, Japanese, Simplified Chinese, Traditional Chinese, Korean, Turkish] https://www.factorio.com true true true 97% 89h 43m Wube Software LTD. [Casual, Indie, Simulation, Strategy]