A4L

Custom Random Class

A4L
Dec 8th, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Chapter18DesigningBuildingClasses
  8. {
  9.     class Ran
  10.     {
  11.         Random ranByte = new Random();
  12.         public byte Byte()
  13.         {
  14.             float r = ranByte.Next(255);
  15.             return Convert.ToByte(r);
  16.         }
  17.         public int Int(int min, int max)
  18.         {
  19.              return ranByte.Next(min, max);
  20.         }
  21.         public int Int(int max)
  22.         {
  23.             return ranByte.Next(max);
  24.         }
  25.  
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment