Skip to main content

Posts

Showing posts with the label game with postgresql

Game with postgreSQL

I developed this game a bit long ago, and would like to share with the world. Yes, ofcourse, we can optimize the code of c here, but i have concentrated only on desired functionality for this. Once, i got the desired result, i haven't looked into any of the line in this code. {Very bad habbit, i need to over come this.} I hope you enjoy it, and correct if any problems occurs. This game is for only 2 players, which will give you the realtime game feel with your opponent. First find the code, and then instructions. C Program -=-=-=-=-=- #include "stdio.h" #include "ncurses.h" #include "/opt/PostgreSQL/9.0/include/libpq-fe.h" #include "stdlib.h" #include "string.h" char symbol[3]; PGconn * PGconnect(char ch) { PGconn *conn; PGresult *res; FILE *fp; int cnt,i=0; char conn_string[500],hostaddr[32],port[7],dbname[50],user[50],password[50],name[10]; const char *paramValues[2]; fp=fopen("/tmp/.cred","...