This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definimos la eleccion del jugador y Arduino a cero. | |
String eleccionJugador = "vacio"; | |
// ==== EMPIEZA EL LOOP() ==== | |
void loop (){ | |
// El jugador define su elección a traves de los 5 botones. | |
if(digitalRead(boton1) == HIGH){ | |
eleccionJugador = "piedra"; | |
}else if(digitalRead(boton2) == HIGH){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definimos la eleccion del jugador y Arduino a cero. | |
String eleccionArduino = "vacio"; | |
// ==== EMPIEZA EL LOOP() ==== | |
void loop (){ | |
// === ELECCIÓN ARDUINO === | |
// la elección de Arduino es un numero al azar entre 1 y 5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resolución en caso de empate. | |
if(eleccionJugador == eleccionArduino){ | |
Serial.print("Empate! "+String(eleccionJugador)+" no gana a "+String(eleccionArduino)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// variable de control de loop while | |
bool run = true; | |
// ==== EMPIEZA EL LOOP() ==== | |
void loop (){ | |
// Loop de control | |
while(run == true){ | |
if(eleccionJugador == eleccionArduino){ | |
Serial.print("Empate! "+String(eleccionJugador)+" no gana a "+String(eleccionArduino)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parámetros del depurador | |
#define DEBUGMODE | |
// ==== EMPIEZA EL SETUP() ==== | |
void setup() { | |
//Activando la comunicación Serial | |
Serial.begin(9600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode( 'posts-list', 'ignacio_posts_list_shortcode' ); | |
function ignacio_posts_list_shortcode( $atts ) { | |
$defaults = array( | |
'items' => 3 | |
); | |
$atts = wp_parse_args( $atts, $defaults ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" method="POST"> | |
<table class="form-table"> | |
<tr> | |
<th scope="row"><?php _e( 'New customer', 'fictizia' ); ?></th> | |
<td> | |
<input type="text" name="cliente" value=""/> | |
</td> | |
</tr> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Split a string into chunks of the given size | |
* @param {String} string is the String to split | |
* @param {Number} size is the size you of the cuts | |
* @return {Array} an Array with the strings | |
*/ | |
function splitString (string, size) { | |
var re = new RegExp('.{1,' + size + '}', 'g'); | |
return string.match(re); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Arranque y control de la repetición | |
*/ | |
// Intervalo que arranca la funcion RunIt, y la repite cada x milisegundos en funcion del valor de "intervalMS". | |
setInterval(runIt, intervalMS); | |
// Función que controla la ejecucción de todo lo demás | |
function runIt () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modo Debug | |
if (debugMode) { | |
console.log("**************"); | |
console.log("Ask($): " + newChange.ask); | |
console.log("Bid($): " + newChange.bid); | |
console.log("Last($): " + newChange.last); | |
console.log("--------------"); | |
console.log("Conversion Rate: "+euroRate); | |
console.log("Currency selected: "+currency); | |
console.log("--------------"); |