spigotcpp/Spigot.hpp
A.M. Rowsell 218d5b7da8
Squashed bug causing incorrect digits. Now fully working
I totally brainfarted and put this->preDigits.size() in the for
loop comparison clause, which gets re-evaluated every loop.
So it was leaving digits on the stack that should have been
printed, causing errors both immediately and down the line.
2023-06-09 12:15:53 -04:00

22 lines
302 B
C++

#ifndef Spigot_h
#define Spigot_h
#include <iostream>
#include <vector>
class Spigot {
public:
/* functions */
Spigot(int requestedNumDigits);
void pump(void);
private:
std::vector<int> spigotList;
int spigotListLength;
int carry;
std::vector<int> preDigits;
};
#endif