I'm now up to the point where I'm porting my knowledge of JavaScript / ActionScript into C++ for mathematical & text based operations:
// Roll a 20-sided dice 30 times
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
const int BASE = 1;
const int MAX = 20;
int main(){
int rolled = 0;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
for(int i=0;i<30;i++){
rolled = rand()%(MAX-BASE+1)+BASE;
cout << rolled << endl;
}
return 0;
}
Am I correct in thinking that I need to investigate OpenGL for portable graphic functions. DirectX would be fine for Windows only, but can OpenGL work across multiple OS platforms, such as Windows, Mac, Linux/Unix, etc?
That said, I may need to import extra compilers for Mac & Linux, but according to the documentation, that's easy to do with Code::Blocks.