Skip to content

Instantly share code, notes, and snippets.

@boukeversteegh
Created April 13, 2013 17:18
Show Gist options
  • Save boukeversteegh/5379264 to your computer and use it in GitHub Desktop.
Save boukeversteegh/5379264 to your computer and use it in GitHub Desktop.
class Gate {
protected:
Out outputs[];
public:
virtual void propagate();
};
void Gate::propagate() {
int noutputs = sizeof(this->outputs)/sizeof(*(this->outputs));
cout << noutputs << " outputs.";
for( int i = 0; i < noutputs; i++ ) {
cout << i << endl;
}
}
class And: public Gate {
private:
In inputs[2];
Out outputs[1];
public:
void in(int, bool);
bool out();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment