Skip to content

Instantly share code, notes, and snippets.

@RQF7
RQF7 / contructores.cpp
Last active March 15, 2018 15:59
Diferencia entre copiar y mover en C++
/*
* Constructores para la clase AES.
* Para simplificar, estoy suponiendo que solo hay un arreglo
* miembro (la llave), en lugar de tres.
*/
/*
* Constructor normal: recibe el tamaño de llave y reserva
* el espacio para el arreglo de la llave.
*/
@RQF7
RQF7 / motor.c
Last active December 7, 2018 18:33
Source code for T-bugs. https://youtu.be/1kzht-VDU5w
/**
* Program for the motor block.
* T-bugs.
* ALIROB IPN.
*/
#include "cubelet.h"
/** ID's of the rotator. */
#define CONTROLER 816343
@RQF7
RQF7 / compiler.cpp
Created December 31, 2018 07:37
Generator of programs for CULET. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
/**
* compiler.cpp
* Generator of programs for the head (rotator cube).
* CULET: a Turing machine with Cubelets and Lego.
*
* Dependencies:
* + jsoncpp: https://github.com/open-source-parsers/jsoncpp
*/
#include <fstream>
@RQF7
RQF7 / rule_110_7x2.json
Created December 31, 2018 07:40
The ECA Rule 110 emulator Turing machine. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
{
"states": [
"S_x0",
"S_01",
"S_11",
"S_L",
"T_x0",
"T_01",
"T_11"
],
@RQF7
RQF7 / duplicator.json
Created December 31, 2018 07:42
The duplicator Turing machine for CULET. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
{
"states": [
"s1",
"s2",
"s3",
"s4",
"s5",
"s6"
],
"initial_state": "s1",
@RQF7
RQF7 / rule_110.c
Created December 31, 2018 07:44
CULET program for rule 110 emulator. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
#include "cubelet.h"
#define DOWN_SENSOR 83755
#define UP_SENSOR 88467
#define THRESHOLD_CERCANY 250
#define DESCENT_TIME_ONE 1200
#define DESCENT_TIME_CERO 700
#define POWER_ROTATOR 76
#define POWER_ROTATOR_RISE 75
@RQF7
RQF7 / duplicator.c
Created December 31, 2018 07:46
CULET program for duplicator Turing machine. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
#include "cubelet.h"
#define DOWN_SENSOR 83755
#define UP_SENSOR 88467
#define THRESHOLD_CERCANY 250
#define DESCENT_TIME_ONE 1200
#define DESCENT_TIME_CERO 700
#define POWER_ROTATOR 76
#define POWER_ROTATOR_RISE 75
/**
* motor.c
* Program for the two drive cubes.
* CULET: a Turing machine with Cubelets and Lego.
*/
#include "cubelet.h"
#define CONTROLLER 85562
#define MOTOR_POWER 80
/**
* led.c
* Program for the light cube.
* CULET: a Turing machine with Cubelets and Lego.
*/
#include "cubelet.h"
#define CONTROLLER 85562
@RQF7
RQF7 / meta_sensor.c
Created May 3, 2019 19:05
Programs for a robotic caterpillar with Cubelets
#include "cubelet.h"
void setup() {
block_value = 0;
}
void loop() {
block_value = maximum();
}