Skip to content

Instantly share code, notes, and snippets.

@ajarmst
Created November 13, 2019 17:01
Show Gist options
  • Save ajarmst/580d5b2f0884d8f98871db436b8cf1d3 to your computer and use it in GitHub Desktop.
Save ajarmst/580d5b2f0884d8f98871db436b8cf1d3 to your computer and use it in GitHub Desktop.
classes.cs
public class Star
{
private static Random _rnd = new Random();
public Point _location { get; private set; }
public Color _color { get; private set; }
public int _size { get; private set; }
public Star( Point p )
{
_location = p;
_color = GDIDrawer.RandColor.GetColor();
_size = _rnd.Next(1, 5) * 5;
}
public void ShowStar(GDIDrawer.CDrawer can)
{
can.AddCenteredEllipse(_location.X, _location.Y, _size, _size, _color);
}
}
public class Word
{
private static Random _rnd = new Random(0);
public string _word { get; private set; }
public int _len { get { return _word.Length; } }
public Word()
{
MakeWord();
}
private void MakeWord()
{
int _len = _rnd.Next(1, 41);
for (int i = 0; i < _len; i++)
_word += (char)_rnd.Next('a', 'z' + 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment