bool LogTransformer::loadFromStream(QTextStream & in)
{
	PatternPtr s = readPattern(in);
	PatternPtr e = readPattern(in);
	if (s && e)
	{
		stimulusStart_ = s;
		stimulusEnd_ = e;
	}
	else
	{
		return false;
	}
	stimulusPatterns_.clear();
	// Read data patterns
	while (!in.atEnd())
	{
		PatternPtr p = readPattern(in);
		if (p)
		{
			stimulusPatterns_.append(p);
		}
		else
		{
			return false;
		}
	}
	return true;
}
Exemplo n.º 2
0
CPattern::CPattern(RASTER *imgContour) : m_lX(0), m_lY(0) {
  if (!readPattern(imgContour)) {
    throw SFileReadError();
  }
  try {
    optimalizeSize();
  } catch (SMemAllocError) {
    throw;
  }
}
Exemplo n.º 3
0
Arquivo: final.c Projeto: kd8bny/HCS12
int main(){
    int pass;
    int score = 0;
    int delayDiff = 5000; //5s   
    setup();
    while(1){
        sendPattern(delayDiff);
        pass = readPattern();
        if(pass == 1){
            makeSound(95);      //passTune
            delayDiff -= 500;   //Increase difficulty -0.5s
            score += 10;
            makePattern();      //new pattern
        }
        else{
            makeSound(10);        //failTune();
            print(1,score);
            PWME = 0x00;    //kill sound
            break;
        }
    }
}