Nos meus tempos de faculdade, quando ainda estava no terceiro período, tivemos disciplina de C e após aprendermos o básico ou o suficiente para começarmos a fazer coisas mais interessante, foi nos passado uma tarefa para que criássemos um jogo do campo minado, mas nada sofisticado, o exercício era para o jogador digitar a jogada e seria retornado em forma textual o resultado, algo como: Ainda falta X bombas no lugar tal… O trabalho era para ser feito em dupla, então, eu e o Rogério, resolvermos fazer um joguinho um pouco mais incrementado. Foi um desafio para ambos e muito divertido. Um detalhe, é que eu era o único cara que usava Linux e algumas coisas no código teve que ser modificadas, mas no final tudo deu certo e ganhamos nota máxima.
*Obs.: Coloquei o jogo sobre a licença GPL2, então caso for modificar e ou redistribuir, não esqueça dos créditos e de compartilhar as alterações feitas.
Vejam algumas imagens do jogo rodando no Shell do Linux
Tela de abertura do jogo:
Tela do jogo iniciado:
Tela de fim do jogo:
O arquivo compilado pode ser baixado aqui: cmin
O código fonte pode ser baixado aqui: cmin.c
Para quem quiser testar, basta baixar o cmin e dar permissão de execução:
chomd +x cmin
Depois um ponto+barra (./) para executá-lo:
./cmin
Olá, não estou conseguindo compilar o código, ao tentar compilar dá os seguinte erros:
darkstarfire@darkstar ~/Desktop $ gcc cmin.c -o cmin
cmin.c:70:2: error: unknown type name ‘bool’
bool status;
^
cmin.c: In function ‘inicia_matriz’:
cmin.c:83:24: error: ‘false’ undeclared (first use in this function)
matriz[i][j].status=false; //true=aberto false=fechado
^
cmin.c:83:24: note: each undeclared identifier is reported only once for each function it appears in
cmin.c: In function ‘desenhar’:
cmin.c:281:28: error: ‘true’ undeclared (first use in this function)
if (matriz[i][j].status==true)
^
cmin.c:299:28: error: ‘false’ undeclared (first use in this function)
if (matriz[i][j].status==false)
^
cmin.c: At top level:
cmin.c:329:60: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
int abrindo_zero(tmatriz matriz[tmat][tmat],int i,int j,int& acerto)
^
cmin.c:519:58: error: unknown type name ‘bool’
void escolha_coordenada(tmatriz matriz[tmat][tmat],int x,bool& parada,int& acerto)
^
cmin.c:519:74: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
void escolha_coordenada(tmatriz matriz[tmat][tmat],int x,bool& parada,int& acerto)
^
cmin.c: In function ‘main’:
cmin.c:597:2: error: unknown type name ‘bool’
bool parada,opcao=true;
^
cmin.c:597:20: error: ‘true’ undeclared (first use in this function)
bool parada,opcao=true;
^
cmin.c:661:11: error: ‘false’ undeclared (first use in this function)
parada=false;
^
darkstarfire@darkstar ~/Desktop $
versão do GCC: gcc version 4.8.2 (GCC)
darkstarfire@darkstar ~/Desktop $ gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/4.8.2/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/4.8.2/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../gcc-4.8.2/configure –prefix=/usr –libdir=/usr/lib64 –mandir=/usr/man –infodir=/usr/info –enable-shared –enable-bootstrap –enable-languages=ada,c,c++,fortran,go,java,lto,objc –enable-threads=posix –enable-checking=release –enable-objc-gc –with-system-zlib –with-python-dir=/lib64/python2.7/site-packages –disable-libunwind-exceptions –enable-__cxa_atexit –enable-libssp –enable-lto –with-gnu-ld –verbose –enable-java-home –with-java-home=/usr/lib64/jvm/jre –with-jvm-root-dir=/usr/lib64/jvm –with-jvm-jar-dir=/usr/lib64/jvm/jvm-exports –with-arch-directory=amd64 –with-antlr-jar=/home/slackware/slackbuilds/gcc/antlr-runtime-3.4.jar –enable-multilib –target=x86_64-slackware-linux –build=x86_64-slackware-linux –host=x86_64-slackware-linux
Thread model: posix
gcc version 4.8.2 (GCC)
darkstarfire@darkstar ~/Desktop $
Muchas gracias por este post! Cuando un blogger pone un aglomeración empeño y trabajo en su trabajo, se siente bien tener una réplica agradecida y educada, si hay o no hay un acuerdo sobre el tema. me encanta. gracias.
Muchas gracias por este post! Cuando un blogger pone un aglomeración empeño y trabajo en su trabajo, se siente bien tener una réplica agradecida y educada, si hay o no hay un acuerdo sobre el tema. me encanta. gracias.
Fedex Bentyl stromectol tablets for dogs We found that upon IgEantigen Ag binding to the highafnity Fc e RI receptor and b adrenergic stimulation of cardiomyocytes LysRS is specically phosphorylated on a serine Ser residue in a MAP kinase MAPKdependent manner
How Does Tadalista Tadalafil Work purchase cialis
clomid for pregnancy Barron Pharmacy- serves OH, MI, FL, PA, HI, TN.
lasix for dogs Monitor Closely 1 dabrafenib will decrease the level or effect of brexpiprazole by affecting hepatic intestinal enzyme CYP3A4 metabolism
Rapid visual inspection permits accurate diagnosis of atrophy, endometrial hyperplasia, polyps, fibroids, retained products of conception, and endometrial cancer buy cheap generic cialis uk Read the Medication Guide provided by your pharmacist before you start using Neophedan and each time you get a refill
While he has not been charged with any crimes since starting his MMA career, he received a three year prison sentence for a brutal assault on a businessman ivermectin scabies 2011 are given as symbols
priligy 30mg price The degree of cardiotoxicity of FU commercial solutions, tested on the isolated perfused rabbit heart model, is a function of the pH of the solution, and the preparations at pH 9
plaquenil generic brand
[url=https://plavixtabs.online/]cheap plavix 75 mg[/url] [url=https://arimidex.fun/]arimidex for pct[/url] [url=https://neurontintabs.online/]how much is neurontin pills[/url] [url=https://happydrugstores.online/]cheap canadian pharmacy[/url]
6 months 95 CI 20 cialis from india
levitra ou cialis generique Monitor Closely 1 propofol and papaverine both increase sedation
js混淆 hello my website is js混淆
xl akrab hello my website is xl akrab
Truyen dragon hello my website is Truyen dragon
Faded (karaoke) hello my website is Faded (karaoke)
jkt48 gadis hello my website is jkt48 gadis
boca bop hello my website is boca bop
sentosa reservation hello my website is sentosa reservation
aplikasi idrpoker hello my website is aplikasi idrpoker
perak 1973 hello my website is perak 1973
Erectile, This is a good website Erectile
Impotence, This is a good website Impotence
Suggestive, This is a good website Suggestive
Nudity, This is a good website Nudity
Blue pill, This is a good website Blue pill
Scrotum, This is a good website Scrotum
Explicit, This is a good website Explicit
Testicles, This is a good website Testicles
Scrotum, This is a good website Scrotum
1, 30 years to the day he became commissioner levitra 20mg generique en ligne Klinefelter syndrome is the strongest risk factor
vidalista 20 centurion laboratories https://community.alteryx.com/t5/user/viewprofilepage/user-id/524454/ purchase Cenforce pill
buy fildena 150 online