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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
printf("Los chars hola y mundo son: %d \n", strcmp("hola", "mundo")); | |
concatenate("111","666"); | |
return 0; | |
} | |
int get_len(char* c, int ctr) { |
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
string bytes = "p,T04◘4◘♦64♣£318♦T-"; // Construya este string con los bytes que da la función de mat_to_byte() concatendo cada posición. | |
char* c_bytes = bytes.c_str(); | |
vector<byte> vec; | |
for( int i = 0; i < bytes.lenght(); i++) { | |
vec.push_back( c_bytes[i] ); | |
} |
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
// Conviertan el binario a string así: | |
int binary_int = 10100110; | |
std::string bin_str = std::to_string( binary_int ); | |
// cuenten los 1 o 0 no se | |
int counter = 0; | |
for( int i = 0; i < bin_str.lenght(); i++ ) { | |
int _integer = std::stoi( bin_str[0] ); | |
if( _integer == 1 ) { // o 0 | |
counter++; |
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
std::thread t( [this,args...]() { | |
a.method(); | |
} ); | |
t.detach |
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
void Jigsaw::set_fittest() { | |
_fittest.clear(); | |
int _first, _second, _third; | |
_first = _second = _third = INT_MIN; | |
for( unsigned int i = 0; i < _population.size(); i++ ) { | |
if( (int)_population[i]._fitness > _first ) { |