Das mit dem RPG fang ich glaub ich mal an 
Aber hier nochmal mein Primzahlen programm mit einer Primzahlentestfunktion und einem array zum testen.
Code:
#include "stdafx.h"
#include "iostream"
#include "math.h"
#include "time.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int x, c, prim, y, f, t, t2;
double time1=0.0, tstart, k, i;
int arr[4800];
cout<<"Wenn sie die Anzahl der Primzahlen von 0 bis x haben wollen geben sie 1 ein.\nWenn sie wissen wollen ob x eine Primzahl ist geben sie 2 ein. ";
do
{
cin>>f;
cout<<"\n";
if(f<1 || f>2)
{
cout<<"Falsche Zahl eingegeben nur 1 und 2 sind erlaubt. Bitte Eingabe wiederholen: ";
}
}while(f<1 || f>2);
if(f==1)
{
cout<<"Bitte eine Zahl eingeben: ";
do
{
cin>>x;
cout<<"\n";
if(x<0)
{
cout<<"Negative Zahlen sind nicht möglich. Bitte Eingabe wiederholen: ";
}
}while(x<0);
if(x<2)
{
prim=0;
}
else
{
prim=1;
}
t=0;
arr[0]=3;
tstart = clock();
for(i=3;i<=x;i+=2)
{
for(k=sqrt(i), y=i, t2=0; arr[t2]<=k+4+t2; t2++)
{
if(y%arr[t2]==0 && arr[t2]<=k)
{
break;
}
else if(arr[t2]>k)
{
if(t<=4800)
{
arr[t]=y;
t++;
}
prim++;
break;
}
}
}
time1 += clock() - tstart;
time1 = time1/CLOCKS_PER_SEC;
cout<<"Zeit = "<<time1<<" Sekunden";
cout<<"\nEs befinden sich insgesamt "<<prim<<" Primzahlen zwischen 0 und "<<x<<"\n\n";
}
else if(f==2)
{
cout<<"Bitte eine Zahl eingeben: ";
do
{
cin>>i;
if(i<0)
{
cout<<"Negative Zahlen sind nicht möglich. Bitte Eingabe wiederholen: ";
}
}while(i<0);
cout<<"\n";
for(k=sqrt(i), c=3, y=i; c<=k+2; c+=2)
{
cout<<fixed;
if(y%c==0 && c<=k || y==1)
{
cout<<y<<" ist keine Primzahl!\n\n";
break;
}
else if(c>k)
{
cout<<y<<" ist eine Primzahl!\n\n";
}
}
}
return 0;
}