Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "smith_counter.h"
- #include<iostream>
- using namespace std;
- smith_counter::smith_counter() {
- count = 0;
- }
- bool smith_counter::get_prediction() {
- bool prediction = count;
- prediction >> 1;
- return prediction;
- }
- void smith_counter::set_prediction(char taken) {
- //cout << taken << endl;
- if ((taken == 'T') && count < 3)
- {
- count++;
- //if (count > 3)
- // count = 3;
- }
- else
- {
- if (count > 0 && count != 3)
- count--;
- }
- }
- //Shayne Georgeoff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement