Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
|
Graph plotting functions. More...
#include "graph.h"
#include "file_io.h"
#include "format.h"
#include <algorithm>
#include <cassert>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
Go to the source code of this file.
Functions | |
void | graph_plotting (const string &player, int stocknum, int width, int height) |
Plot the graph of the stock price history to std::cout. | |
vector< float > | graphinput (const string &player, int stocknum, string &stockname, unsigned int width) |
string | graphpriceformat (float price) |
void | printgraphblocks (const vector< vector< string > > &screenElements, const vector< string > &specifiedColorCoordinates, const int width, const int height) |
void | printstocknameandoverall (const string &stockname, vector< float > stockpricehistory, int stocknum) |
Graph plotting functions.
Definition in file graph.cpp.
void graph_plotting | ( | const std::string & | player, |
int | stocknum, | ||
int | width, | ||
int | height ) |
Plot the graph of the stock price history to std::cout.
player | the name of the player |
stocknum | the stock number of the stock, -1 for HSI |
width | the width of the graph |
height | the height of the graph |
Definition at line 135 of file graph.cpp.
References graphinput(), graphpriceformat(), printgraphblocks(), printstocknameandoverall(), textGreen, textRed, and textWhite.
Referenced by main().
vector< float > graphinput | ( | const string & | player, |
int | stocknum, | ||
string & | stockname, | ||
unsigned int | width ) |
Definition at line 98 of file graph.cpp.
References SAVE_FILE_EXTENSION_TXT, and SAVE_FOLDER_PREFIX.
Referenced by graph_plotting().
string graphpriceformat | ( | float | price | ) |
Definition at line 30 of file graph.cpp.
Referenced by graph_plotting(), and printstocknameandoverall().
void printgraphblocks | ( | const vector< vector< string > > & | screenElements, |
const vector< string > & | specifiedColorCoordinates, | ||
const int | width, | ||
const int | height ) |
Definition at line 67 of file graph.cpp.
References textDefault, textGreen, and textRed.
Referenced by graph_plotting().
void printstocknameandoverall | ( | const string & | stockname, |
vector< float > | stockpricehistory, | ||
int | stocknum ) |
Definition at line 50 of file graph.cpp.
References graphpriceformat().
Referenced by graph_plotting().