Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.74 KB | None | 0 0
  1. public class PruebaNames : MonoBehaviour {
  2.  
  3.     int lastIndex = 0;
  4.     int inputDone = 0;
  5.     // Use this for initialization
  6.     void Start () {
  7.         string str="";
  8.         /*for(int i=116;i<=181;i++)
  9.         {
  10.             str = str +Editions(i);
  11.         }*/
  12.         int i;
  13.         for (i = 1; i <= 1000; i++)
  14.         {
  15.             str = str + VgReviews(i);
  16.         }
  17.         Debug.Log("Escribiendo a File");
  18.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  19.         Debug.Log("Done");
  20.          str = "";
  21.         for ( i =1001; i <= 2000; i++)
  22.         {
  23.             str = str + VgReviews(i);
  24.         }
  25.  
  26.         Debug.Log("Escribiendo a File");
  27.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  28.         Debug.Log("Done");
  29.          str = "";
  30.         for ( i = 2001; i <= 3000; i++)
  31.         {
  32.             str = str + VgReviews(i);
  33.         }
  34.         Debug.Log("Escribiendo a File");
  35.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  36.         Debug.Log("Done");
  37.         str = "";
  38.         for (i = 3001; i <= 4000; i++)
  39.         {
  40.             str = str + VgReviews(i);
  41.         }
  42.         Debug.Log("Escribiendo a File");
  43.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  44.         Debug.Log("Done");
  45.         str = "";
  46.         for (i = 4001; i <= 5000; i++)
  47.         {
  48.             str = str + VgReviews(i);
  49.         }
  50.         Debug.Log("Escribiendo a File");
  51.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  52.         Debug.Log("Done");
  53.         str = "";
  54.         for (i = 5001; i <= 5845; i++)
  55.         {
  56.             str = str + VgReviews(i);
  57.         }
  58.         Debug.Log("Escribiendo a File");
  59.         System.IO.File.AppendAllText("D:/Escritorio/reviews.txt", str);
  60.         Debug.Log("Done");
  61.         str = "";
  62.     }
  63.    
  64.     // Update is called once per frame
  65.     void Update () {
  66.    
  67.     }
  68.  
  69.     private string  Editions(int vgindex){
  70.         System.Random rnd = new System.Random();
  71.       Debug.Log("VGINDEX "+vgindex);
  72.       string[] editionList = {"Normal","Limited","Deluxe","Ultimate","Collectors","Ultimate Collectors"};
  73.       var word = "";
  74.       var ranEdition = rnd.Next(3, 7);
  75.       Debug.Log("NUMBER OF EDITIONS "+ranEdition);
  76.       int  inputDone=0;
  77.       int Edtype;
  78.       for(int i=0;i<ranEdition;i++)
  79.       {
  80.         Edtype = rnd.Next(1, 3);
  81.         Debug.Log("Physical or Digital " + Edtype);
  82.         for(int j=0;j<Edtype;j++)
  83.         {
  84.           word = word + "("+(lastIndex+inputDone)+",'"+editionList[i]+"',"+vgindex+","+(j+1)+"),";
  85.           inputDone++;    
  86.         }
  87.       }
  88.       lastIndex = lastIndex + inputDone;
  89.       return word;
  90.     }
  91.  
  92.     private string VGReleases(int editionIndex)
  93.     {
  94.         System.Random rnd = new System.Random();
  95.         string word = "";
  96.         string date = "2016-01-01";
  97.         int regions, platforms;
  98.         float[] prices = { 39.9f, 59.99f, 89.99f, 99.99f, 109.9f, 119.9f };
  99.         int[] expectancies = { 1980000, 990000, 660000, 495000, 396000, 330000 , 247500 , 220000 , 198000,165000,132000,123750,110000,99000,82500,79200,66000};
  100.         if(rnd.Next(1,101)%2==0)
  101.         {
  102.             platforms = rnd.Next(1, 3);
  103.         }
  104.         else
  105.         {
  106.             if((rnd.Next(1,101)%2==0))
  107.             {
  108.                 platforms = rnd.Next(1, 6);
  109.             }
  110.             else
  111.             {
  112.                 platforms = rnd.Next(1, 4);
  113.             }
  114.         }
  115.         if(rnd.Next(1,101)%2==0)
  116.         {
  117.             regions = rnd.Next(1, 4);
  118.         }
  119.         else
  120.         {
  121.             if(rnd.Next(1,101)%2==0)
  122.             {
  123.                 regions = rnd.Next(1, 7);
  124.             }
  125.             else
  126.             {
  127.                 regions = rnd.Next(1, 5);
  128.             }
  129.         }
  130.         int expectanciesLevel = platforms * regions;
  131.         int expectancyIndex;
  132.         switch(expectanciesLevel)
  133.         {
  134.             case 1: expectancyIndex = 0; break;
  135.             case 2: expectancyIndex = 1; break;
  136.             case 3: expectancyIndex = 2; break;
  137.             case 4: expectancyIndex = 3; break;
  138.             case 5: expectancyIndex = 4; break;
  139.             case 6: expectancyIndex = 5; break;
  140.             case 8: expectancyIndex = 6; break;
  141.             case 9: expectancyIndex = 7; break;
  142.             case 10: expectancyIndex = 8; break;
  143.             case 12: expectancyIndex = 9; break;
  144.             case 15: expectancyIndex = 10; break;
  145.             case 16: expectancyIndex = 11; break;
  146.             case 18: expectancyIndex = 12; break;
  147.             case 20: expectancyIndex = 13; break;
  148.             case 24: expectancyIndex = 14; break;
  149.             case 25: expectancyIndex = 15; break;
  150.             case 30: expectancyIndex = 16; break;
  151.             default: expectancyIndex = 8; break;
  152.         }
  153.         for(int i=1;i<=regions;i++)
  154.         {
  155.             for(int j=1;j<=platforms;j++)
  156.             {
  157.                 /*creationChance = rnd.Next(1, 101);
  158.                 if(creationChance%5==0)
  159.                 {*/
  160.                     word = word + "(" + (inputDone + 1) + ",'" + date + "',"+"59.99"+"," + expectancies[expectancyIndex] + "," + editionIndex + "," + j + "," + i + "),";
  161.                     inputDone++;
  162.                 //}
  163.             }
  164.         }
  165.         return word;
  166.     }
  167.  
  168.     private string VgReviews(int releaseIndex)
  169.     {
  170.         System.Random rnd = new System.Random();
  171.         string word = "";
  172.         int score;
  173.         for (int i = 1; i <= 30;i++ )
  174.         {
  175.             if(rnd.Next(1,101)%3==0)
  176.             {
  177.                 score = rnd.Next(20, 101);
  178.                 word = word + "(" + (inputDone + 1) + "," + score + "," + i + "," + releaseIndex +"),";
  179.                 inputDone++;
  180.             }
  181.         }
  182.  
  183.             return word;
  184.     }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement