From 862bcb6c0b03adeb979c40e7f8828ac5dbcff042 Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 8 Oct 2018 16:45:11 -0300 Subject: [PATCH] "Se agregó el archivo de juego toros y vacas!" --- a.out | Bin 0 -> 13800 bytes torosvacas.cpp | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100755 a.out create mode 100644 torosvacas.cpp diff --git a/a.out b/a.out new file mode 100755 index 0000000..f001a84 Binary files /dev/null and b/a.out differ diff --git a/torosvacas.cpp b/torosvacas.cpp new file mode 100644 index 0000000..25d2167 --- /dev/null +++ b/torosvacas.cpp @@ -0,0 +1,163 @@ +#include +#define N 4 +#define INTENTOS 12 + +void separar_numeros(int vector[N], int numero); +int aleatorio(int x, int y); +bool tiene_cuatro_digitos(int n); + +using namespace std; + + + +int main(){ + + srand(time(NULL)); + + int numero_pensado[N]; + int numero_input[N]; + int input; + + bool error = false; + + for(int i=0; i> input; + if(!tiene_cuatro_digitos(input)){ + cout << "Jugada Inválida - Número Inválido\n"; + error = true; + //i--; + continue; + }else{ + error = false; + + + separar_numeros(numero_input, input); + + + for (int j = 0; j < N; j++) + { + for(int k=j+1; k