#include "spec.h"

Let UpperCase(Let it, Let rest[]){
	if (it <= 'z' && it >= 'a'){
		it = it - 'a' + 'A';
	}
	return it;
}

Let NoWhiteSpace(Let it, Let rest[]){
	return it != ' ';
}

Let LowerCase(Let it, Let rest[]){
	if (it <='Z' && it >='A'){
		it = it - 'A' + 'a';
	}
	return it;
}

Let logo(Let index, Let lst[]){
	if (index > 0 && index % 6 == 0){
		Permute(&lst[index-1]);
		lst[index-1] = '\n';
	}
	return lst[index];
}


void sega(Co ck){
	Let data[100] = {0};
	Take(data,"welcome to the next level sega");
	Transform(data,UpperCase);
	Predicate(data,NoWhiteSpace);
	Enumerate(data,logo);
	Str(data);

	ck->routine = 0;
}


