<commit_before><commit_msg>Gradient sketch<commit_after>void setRed( void ) {
	ledOn(BODY_RGB_RED_PIN);
  ledOff(BODY_RGB_BLUE_PIN);
  ledOff(BODY_RGB_GREEN_PIN);
}

void setBlue( void ) {
	ledOff(BODY_RGB_RED_PIN);
  ledOn(BODY_RGB_BLUE_PIN);
  ledOff(BODY_RGB_GREEN_PIN);
}

void setGreen( void ) {
	ledOff(BODY_RGB_RED_PIN);
  ledOff(BODY_RGB_BLUE_PIN);
  ledOn(BODY_RGB_GREEN_PIN);
}

void setWhite( void ) {
	ledOn(BODY_RGB_RED_PIN);
  ledOn(BODY_RGB_BLUE_PIN);
  ledOn(BODY_RGB_GREEN_PIN);
}

void setBlack( void ) {
	ledOff(BODY_RGB_RED_PIN);
  ledOff(BODY_RGB_BLUE_PIN);
  ledOff(BODY_RGB_GREEN_PIN);
}

void branch( u32 sourceFace, u32 distance ) {
	if (sourceFace != NORTH) facePrintf(NORTH,"g%d\n",distance);
	if (sourceFace != SOUTH) facePrintf(SOUTH,"g%d\n",distance);
	if (sourceFace != EAST) facePrintf(EAST,"g%d\n",distance);
	if (sourceFace != WEST) facePrintf(WEST,"g%d\n",distance);
}

void setGradient( u8 * packet ) {
	u32 distance;
	packetScanf(packet,"g%d\n",&distance);
	
	setBlack();
	
	if (distance == 1) setBlue();
	else if (distance == 2) setGreen();
	else if (distance == 3) setWhite();
	
	branch(packetSource(packet), distance + 1);
}

void stealGradient(  ) {
	setRed();
	branch(0,1);
}

void setup() {
	Body.reflex('g', setGradient);
}

void loop() {
  if (buttonDown()) {
    stealGradient();
  } 
}
{'fraction_non_alphanumeric': 0.15765765765765766, 'fraction_numerical': 0.00975975975975976, 'mean_word_length': 5.665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1816246', 'n_tokens_mistral': 599, 'n_tokens_neox': 568, 'n_words': 91}