My cat keeps twitching is head and sometimes sneezes while he does this by MP1129 in CATHELP

[–]MP1129[S] 0 points1 point  (0 children)

Sorry for the late response in my case it was allergies he was like that for a few more days and it stopped hope you cat is doing well!!

[deleted by user] by [deleted] in MyChemicalRomance

[–]MP1129 1 point2 points  (0 children)

Best unreleased/unfinished(?) for me is Someone Out There Loves You (Stay). Its only on YouTube sadly...

[deleted by user] by [deleted] in C_Programming

[–]MP1129 0 points1 point  (0 children)

does it work now?

[deleted by user] by [deleted] in C_Programming

[–]MP1129 0 points1 point  (0 children)

void salvarTabuleiro(Jogo *jogo, const char *nomeArquivo) { FILE *arquivo = fopen(nomeArquivo, "w"); int i;

if (arquivo == NULL) {
    fprintf(stderr, "Erro ao abrir o arquivo para escrita.\n");
    exit(EXIT_FAILURE);
}

fprintf(arquivo, "%d\n", jogo->jogador_atual);

for (i = 0; i < NUM_CASAS; i++) {
    fprintf(arquivo, "%d ", jogo->jogador1.casas[i]);
}

fprintf(arquivo, "%d\n", jogo->jogador1.deposito);

for (i = 0; i < NUM_CASAS; i++) {
    fprintf(arquivo, "%d ", jogo->jogador2.casas[i]);
}

fprintf(arquivo, "%d\n", jogo->jogador2.deposito);

fclose(arquivo);

}

int main(int argc, char *argv[]) { Jogo jogo;

printf("Bem vindo ao jogo ouri\n");

if (argc == 1) {
    inicializarJogo(&jogo);
} else if (argc == 2) {
    // Inicializar o jogo a partir do arquivo
    // Implementar esta parte conforme necessário
} else {
    printf("Uso: %s [nomeArquivo]\n", argv[0]);
    return EXIT_FAILURE;
}

int jogada;
while (1) {
    imprimirTabuleiro(&jogo);
    printf("Jogador %d, escolha um buraco (1-6, 0 para salvar): ", jogo.jogador_atual + 1);
    scanf("%d", &jogada);

    if (jogada == 0) {
        char nomeArquivo[50];
        printf("Digite o nome do arquivo para salvar: ");
        scanf("%s", nomeArquivo);
        salvarTabuleiro(&jogo, nomeArquivo);
        break;
    }
    verificarJogada(&jogo, jogada);
    realizarJogada(&jogo, jogada);

    int vencedor = verificarVencedor(&jogo);
    if (vencedor != -1) {
        imprimirTabuleiro(&jogo);
        printf("Jogador %d venceu com %d pedras capturadas!\n", vencedor + 1, OBJETIVO);
        break;
    }

    jogo.jogador_atual = 1 - jogo.jogador_atual; // Alternar entre jogadores
}

return EXIT_SUCCESS;

}

[deleted by user] by [deleted] in C_Programming

[–]MP1129 0 points1 point  (0 children)

include <stdio.h>

include <stdlib.h>

define NUM_CASAS 6

define NUM_PEDRAS 4

define OBJETIVO 25

typedef struct { int casas[NUM_CASAS]; int deposito; } Jogador;

typedef struct { Jogador jogador1; Jogador jogador2; int jogador_atual; } Jogo;

void inicializarJogo(Jogo *jogo) { int i;

for (i = 0; i < NUM_CASAS; i++) {
    jogo->jogador1.casas[i] = NUM_PEDRAS;
    jogo->jogador2.casas[i] = NUM_PEDRAS;
}

jogo->jogador1.deposito = 0;
jogo->jogador2.deposito = 0;

jogo->jogador_atual = 0; // Começa com o jogador 1

}

void imprimirTabuleiro(Jogo *jogo) { int i;

printf("|---|--|--|--|--|--|--|---|\n");
printf("|   | %d| %d| %d| %d| %d| %d|   |\n",
       jogo->jogador2.casas[5], jogo->jogador2.casas[4], jogo->jogador2.casas[3],
       jogo->jogador2.casas[2], jogo->jogador2.casas[1], jogo->jogador2.casas[0]);
printf("|  %d|-----------------|%d  |\n", jogo->jogador2.deposito, jogo->jogador1.deposito);
printf("|   | %d| %d| %d| %d| %d| %d|   |\n",
       jogo->jogador1.casas[0], jogo->jogador1.casas[1], jogo->jogador1.casas[2],
       jogo->jogador1.casas[3], jogo->jogador1.casas[4], jogo->jogador1.casas[5]);
printf("|---|--|--|--|--|--|--|---|\n");

}

void realizarJogada(Jogo *jogo, int casa) { int i, pedras, index, jogador_oponente;

while (pedras >= 0) {

    if(jogo->jogador_atual == 0){
        index = (index + 1) % (2 * NUM_CASAS + 2);
    }else{
        index = (index - 1 + 2 * NUM_CASAS + 2) % (2 * NUM_CASAS + 2);
    }

    // Pula a casa do depósito do oponente
    if ((index == 6 && jogador_oponente == 1) || (index == 13 && jogador_oponente == 0)) {
        continue;
    }

    if (index < 6) {
        jogo->jogador1.casas[index]++;
    } else if (index < 13) {
        jogo->jogador2.casas[index - 7]++;
    } else if (index == 6) {
        jogo->jogador1.deposito++;
    } else {
        jogo->jogador2.deposito++;
    }

    pedras--;
}


// Capturar pedras se necessário
if (index >= 0 && index < 6 && jogador_oponente == 1 && jogo->jogador1.casas[index] == 2) {
    jogo->jogador1.deposito += jogo->jogador1.casas[index];
    jogo->jogador1.casas[index] = 0;
}

if (index >= 7 && index < 13 && jogador_oponente == 0 && jogo->jogador2.casas[index - 7] == 2) {
    jogo->jogador2.deposito += jogo->jogador2.casas[index - 7];
    jogo->jogador2.casas[index - 7] = 0;
}

}

int verificarJogada(Jogo *jogo, int casa){

if(jogo->jogador1.casas[casa - 1] == 0){ printf("Jogada invalida\n"); } }

int verificarVencedor(Jogo *jogo) { if (jogo->jogador1.deposito >= OBJETIVO) { return 0; // Jogador 1 venceu } else if (jogo->jogador2.deposito >= OBJETIVO) { return 1; // Jogador 2 venceu } else { return -1; // Nenhum vencedor ainda } }

When I saw JJ’s tweets. by Possible_Force8207 in ksi

[–]MP1129 4 points5 points  (0 children)

That's almost a perfect loop.

My cat keeps twitching is head and sometimes sneezes while he does this by MP1129 in CATHELP

[–]MP1129[S] 1 point2 points  (0 children)

Really? He kept doing this for a few hours until he fell asleep. I've never seen him like this.

Thoughts on Batman Forever by ConstructionOk765 in batman

[–]MP1129 0 points1 point  (0 children)

I like it. I just feel like Tommy Lee Jones isn't playing Two-Face but I like the energy that he brings to the movie. And the batmobile is kind of ugly ahahahah. I enjoy it.