Nice. Best of luck with the project.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
// Script header for module 'as'
int CountFirst[10];
int CountSecond[10];
int CountThird[10];
struct Mankind {
int Team;
};
int returno;
Mankind Man[500];
enum FirstOption {
primero,
segundo,
tercero
};
function first (FirstOption tipos) {
int auxiliar,counter;
int RanNo;
RanNo = Random(99);
if(tipos == primero) {
if(RanNo < 0) returno = 1;
else if(RanNo < 100) returno = 2;
}
if(tipos == segundo) {
if(RanNo < 100) returno = 1;
else if(RanNo < 100) returno = 2;
}
if(tipos == tercero) {
if(RanNo < 50) returno = 1;
else if(RanNo < 100) returno = 2;
}
auxiliar = returno;
if(tipos == 1) {CountFirst[auxiliar]++; }
if(tipos == 2) {CountSecond[auxiliar]++; }
if(tipos == 3) {CountThird[auxiliar]++; }
}
function RAPIDO () {
int auxiliar,counter;
//Makes all cero
while (counter < 10) {
CountFirst[counter] = 0;
CountSecond[counter] = 0;
CountThird[counter] = 0;
counter++;
}
counter = 0;
while (counter < 500) {
first(1);
first(2);
first(3);
counter++;
}
}
// IN GLOBLAL SCRIPT
if(IsKeyPressed(32)) {
RAPIDO();
Display("First 0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountFirst[0], CountFirst[1], CountFirst[2], CountFirst[3], CountFirst[4], CountFirst[5]);
Display("Second 0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountSecond[0], CountSecond[1], CountSecond[2], CountSecond[3], CountSecond[4], CountSecond[5]);
Display("Third 0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountThird[0], CountThird[1], CountThird[2], CountThird[3], CountThird[4], CountThird[5]);
}
Quoteif (RanNo < 20) return wFat;
QuoteMan[counter].Weight = GetStat(pWeight);Ashen... Im seeing your solution right now and I think it works... but as it is if
// Script header for module 'as'
int TeamCount[10];
int tipo;
struct Mankind {
int Team;
};
int returno;
Mankind Man[500];
enum SecondOption {
primero,
segundo,
tercero
};
function second (SecondOption param) {
int RanNo;
RanNo = Random(99);
if (param == primero) {
if(RanNo < 0) returno = 1; // Its meant to be ALWAYS 2 (for testing)
else if(RanNo < 100) returno = 2;
}
if (param == segundo) {
if(RanNo < 50) returno = 1; // Its meant to be 1 or 2 50% each (for testing)
else if(RanNo < 100) returno = 2;
}
if (param == tercero) {
if(RanNo < 100) returno = 1; // Its meant to be ALWAYS 1 (for testing)
else if(RanNo < 0) returno = 2;
}
}
function first () {
int auxiliar,counter;
//Pone todo en 0
while (counter < 10) {
TeamCount[counter] = 0;
counter++;
}
counter = 0;
while (counter < 500) {
if((tipo > 3) || (tipo < 1)) { tipo = 1;}
if(tipo == 1) {
second(primero);
auxiliar = returno;
}
if(tipo == 2) {
second(segundo);
auxiliar = returno;
}
if(tipo == 3) {
second(tercero);
auxiliar = returno;
}
TeamCount[auxiliar]++;
counter++;
tipo++;
}
}
//END OF MODULE HEADER
I DID THE FOLLOWING TO CHECK AND IT CHOOSES THE 50 50 VALUES NO MATTER WHAT ENUM I RUN. IVE TRIED IT WITH OTHER EXAMPLES...
// main global script file
#sectionstart repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
if(IsKeyPressed(32)) {
first();
Display("Tipo %d",tipo);
Display("0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", TeamCount[0], TeamCount[1], TeamCount[2], TeamCount[3], TeamCount[4], TeamCount[5]);
}
}
[CODE]
// Script header for module 'soc'
int g, a, b;
String sg;
int aeamnumber = 5; // this would be the number of teams in this case 6
int aatches = 2; // Number of matches played per week in this case 3
struct eams {
String Name;
int EconSitu;
int played[20];
int MediaAttack;
int MediaDefensa;
String Manager;
int FechaMatch;
String Stadium;
};
eams team[20];
int FechaLeague;
struct eague {
String Match[10];
int match[10];
};
eague league[20];
function nineteenrandom () { // I dont use it, but i could and it would be the same
int f;
if (f > 19) {
f = 0;
}
f++;
}
function whilee (int teamnumber, int matches) { // this is where the problems start, in this while that I transformed into an independent function trying to solve them but the problems remain. THIS IS THE LINE WHERE THE LOOP CROSSES THE 15001.
while((team[a].played[b] > 0) || (team[b].FechaMatch > FechaLeague) || (a == b)) { // did they play against each other?, Has "b" Played this week?, and if "a" equals "b"
g++;
// if(g > 100) { Display("%d", g); }
b++;
if (b > teamnumber) {
b = 0;
// Display("did they play against each other?: %d match %d Week %d", team[b].played[a], team[b].FechaMatch, FechaLeague);
}
}
}
function /*noloopcheck*/ dostuff (int teamnumber, int matches) { // teamnumber 19, matches 9
a = Random(teamnumber);
b = Random(teamnumber);
int c, d = 0;
int f;
File *output = File.Open("stats.txt", eFileWrite);
while(FechaLeague < teamnumber) { // If all matches are played
while(c <= matches) { // if last match of the week is played
while(team[a].FechaMatch > FechaLeague) { // if "a" played this week
a = Random(teamnumber);
}
}
whilee (teamnumber, matches);
/* while((team[a].played[b] > 0) || (team[b].FechaMatch > FechaLeague) || (a == b)) { // if they played against each other, if "b" played this week, and if "a" equals "b"
g++;
// if(g > 100) { Display("%d", g); }
b++;
if (b > teamnumber) {
b = 0;
// Display("did they play against each other: %d Fechamatch(match) %d FechaLeague(week) %d", team[b].played[a], team[b].FechaMatch, FechaLeague);
}
}*/
team[a].played[b]++; // writes that they play against each other
team[b].played[a]++; // ditto
team[a].FechaMatch++; // writes that it played this week
team[b].FechaMatch++; // ditto
// Display("Fecha(week) %d Partido(match) %d %s Vs %s", d, c, team[a].Name, team[b].Name);
//output.WriteInt(a);
//output.WriteInt(b);
output.WriteString(team[a].Name);
output.WriteString(" Vs ");
output.WriteRawLine(team[b].Name);
league[d].match[c] = 1;
//league[d].Match[c] = "a Vs b";
c++;
}
output.WriteRawLine("Fecha");
d++; // new week
FechaLeague = d; // ditto
c = 0; // Match 0
}
output.Close();
}
// Script header for module 'list'
/*struct eams {
String Name;
int EconSitu;
int played[19];
int MediaAttack;
int MediaDefensa;
String Manager;
int FechaMatch;
String Stadium;
};*/
function maketeams () { // In case you wonder this are Argentinian games (Best League of the world!!) ;)
team[0].Name = "Argentinos";
team[1].Name = "Arsenal";
team[2].Name = "Banfield";
team[3].Name = "Belgrano";
team[4].Name = "Boca";
team[5].Name = "Colon";
team[6].Name = "Estudiantes";
team[7].Name = "Gimnasia de Jujuy";
team[8].Name = "Gimnasia de la Plata";
team[9].Name = "Godoy Cruz";
team[10].Name = "Independiente";
team[11].Name = "Lanus";
team[12].Name = "Newells";
team[13].Name = "Nueva Chicago";
team[14].Name = "Quilmes";
team[15].Name = "Racing";
team[16].Name = "River";
team[17].Name = "Rosario Central";
team[18].Name = "San Lorenzo";
team[19].Name = "Velez";
}
$$$!$$$ MS 1 -320440618
// Main script for module 'list'
function whatever () {Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, // I run it at gamestart or if I use a reset button
Ã, int tmp,ii=0;
Ã, while(ii<=4){
Ã, Ã, RaceCount[ii]=0;
Ã, Ã, ii++;
Ã, }
Ã, ii=0;
Ã, while (ii<=10){
Ã, Ã, tmp = Random(4);
Ã, Ã, RaceCount[tmp]++;
Ã, Ã, member[ii] = Species[tmp];
Ã, Ã, ii++;
Ã, }
}
/// Script header of a module ///////////////////////////////
String Species[5];
String member[11];
int RaceCount[5];
Species[0] = "Men";
Species[1] = "Aliens";
Species[2] = "Khudans";
Species[3] = "Ewoks";
Species[4] = "Chewys";
function whatever () {Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, // I run it at gamestart or if I use a reset button
Ã, int tmp,ii=0;
Ã, while(ii<=4){
Ã, Ã, RaceCount[ii]=0;
Ã, Ã, ii++;
Ã, }
Ã, ii=0;
Ã, while (ii<=10){
Ã, Ã, tmp = Random(4);
Ã, Ã, RaceCount[tmp]++;
Ã, Ã, member[ii] = Species[tmp];
Ã, Ã, ii++;
Ã, }
}
function GetSpecies() {
Ã, int Which = Random (99);
Ã, if (Which < 50) return 0;
Ã, else if (Which < 70) return 1;
Ã, else if (Which < 85) return 2;
Ã, else if (Which < 95) return 3;
Ã, else return 4;
}
function whatever () {Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, // I run it at gamestart or if I use a reset button
member[0] = Species[GetSpecies()];
member[2] = Species[GetSpecies()];
member[3] = Species[GetSpecies()];
member[4] = Species[GetSpecies()];
member[5] = Species[GetSpecies()];
member[6] = Species[GetSpecies()];
member[7] = Species[GetSpecies()];
member[8] = Species[GetSpecies()];
member[9] = Species[GetSpecies()];
member[10] = Species[GetSpecies()];
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.095 seconds with 13 queries.