Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PruebaNames : MonoBehaviour {
- int lastIndex = 0;
- int inputDone = 0;
- // Use this for initialization
- void Start () {
- string str="";
- /*for(int i=116;i<=181;i++)
- {
- str = str +Editions(i);
- }*/
- int i;
- for (i = 1; i <= 1000; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- for ( i =1001; i <= 2000; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- for ( i = 2001; i <= 3000; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- for (i = 3001; i <= 4000; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- for (i = 4001; i <= 5000; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- for (i = 5001; i <= 5845; i++)
- {
- str = str + VgReviews(i);
- }
- Debug.Log("Escribiendo a File");
- System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
- Debug.Log("Done");
- str = "";
- }
- // Update is called once per frame
- void Update () {
- }
- private string Editions(int vgindex){
- System.Random rnd = new System.Random();
- Debug.Log("VGINDEX "+vgindex);
- string[] editionList = {"Normal","Limited","Deluxe","Ultimate","Collectors","Ultimate Collectors"};
- var word = "";
- var ranEdition = rnd.Next(3, 7);
- Debug.Log("NUMBER OF EDITIONS "+ranEdition);
- int inputDone=0;
- int Edtype;
- for(int i=0;i<ranEdition;i++)
- {
- Edtype = rnd.Next(1, 3);
- Debug.Log("Physical or Digital " + Edtype);
- for(int j=0;j<Edtype;j++)
- {
- word = word + "("+(lastIndex+inputDone)+",'"+editionList[i]+"',"+vgindex+","+(j+1)+"),";
- inputDone++;
- }
- }
- lastIndex = lastIndex + inputDone;
- return word;
- }
- private string VGReleases(int editionIndex)
- {
- System.Random rnd = new System.Random();
- string word = "";
- string date = "2016-01-01";
- int regions, platforms;
- float[] prices = { 39.9f, 59.99f, 89.99f, 99.99f, 109.9f, 119.9f };
- int[] expectancies = { 1980000, 990000, 660000, 495000, 396000, 330000 , 247500 , 220000 , 198000,165000,132000,123750,110000,99000,82500,79200,66000};
- if(rnd.Next(1,101)%2==0)
- {
- platforms = rnd.Next(1, 3);
- }
- else
- {
- if((rnd.Next(1,101)%2==0))
- {
- platforms = rnd.Next(1, 6);
- }
- else
- {
- platforms = rnd.Next(1, 4);
- }
- }
- if(rnd.Next(1,101)%2==0)
- {
- regions = rnd.Next(1, 4);
- }
- else
- {
- if(rnd.Next(1,101)%2==0)
- {
- regions = rnd.Next(1, 7);
- }
- else
- {
- regions = rnd.Next(1, 5);
- }
- }
- int expectanciesLevel = platforms * regions;
- int expectancyIndex;
- switch(expectanciesLevel)
- {
- case 1: expectancyIndex = 0; break;
- case 2: expectancyIndex = 1; break;
- case 3: expectancyIndex = 2; break;
- case 4: expectancyIndex = 3; break;
- case 5: expectancyIndex = 4; break;
- case 6: expectancyIndex = 5; break;
- case 8: expectancyIndex = 6; break;
- case 9: expectancyIndex = 7; break;
- case 10: expectancyIndex = 8; break;
- case 12: expectancyIndex = 9; break;
- case 15: expectancyIndex = 10; break;
- case 16: expectancyIndex = 11; break;
- case 18: expectancyIndex = 12; break;
- case 20: expectancyIndex = 13; break;
- case 24: expectancyIndex = 14; break;
- case 25: expectancyIndex = 15; break;
- case 30: expectancyIndex = 16; break;
- default: expectancyIndex = 8; break;
- }
- for(int i=1;i<=regions;i++)
- {
- for(int j=1;j<=platforms;j++)
- {
- /*creationChance = rnd.Next(1, 101);
- if(creationChance%5==0)
- {*/
- word = word + "(" + (inputDone + 1) + ",'" + date + "',"+"59.99"+"," + expectancies[expectancyIndex] + "," + editionIndex + "," + j + "," + i + "),";
- inputDone++;
- //}
- }
- }
- return word;
- }
- private string VgReviews(int releaseIndex)
- {
- System.Random rnd = new System.Random();
- string word = "";
- int score;
- for (int i = 1; i <= 30;i++ )
- {
- if(rnd.Next(1,101)%3==0)
- {
- score = rnd.Next(20, 101);
- word = word + "(" + (inputDone + 1) + "," + score + "," + i + "," + releaseIndex +"),";
- inputDone++;
- }
- }
- return word;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement