<commit_before>[Week 5 Home](./)

# U2.W5: Die Class 1: Numeric


## Learning Objectives
- objective 1
- objective 2
- objective 3

## Background
Implement a basic `Die` class which can be initialized with some number of sides.  We can then roll the die, returning a random number.  It should work like this:

```ruby
die = Die.new(6)
die.sides # returns 6
die.roll # returns a random number between 1 and 6
```

If we pass `Die.new` a number less than `1`, we should raise an `ArgumentError`.  This is done using the `raise` keyword.  See the [ArgumentError documentation](http://apidock.com/ruby/ArgumentError) for how to do this.

Use the Ruby Docs to see how to return a random number. 
<commit_msg>added instructions<commit_after>[Week 5 Home](./)

# U2.W5: Die Class 1: Numeric


## Learning Objectives
- objective 1
- objective 2
- objective 3

## Background
Implement a basic `Die` class which can be initialized with some number of sides.  We can then roll the die, returning a random number.  It should work like this:

```ruby
die = Die.new(6)
die.sides # returns 6
die.roll # returns a random number between 1 and 6
```

If we pass `Die.new` a number less than `1`, we should raise an `ArgumentError`.  This is done using the `raise` keyword.  See the [ArgumentError documentation](http://apidock.com/ruby/ArgumentError) for how to do this.

Use the [Ruby Docs](http://www.ruby-doc.org/) to see how to return a random number. 

{'fraction_non_alphanumeric': 0.0965948575399583, 'fraction_numerical': 0.01667824878387769, 'mean_word_length': 3.8, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4856149', 'n_tokens_mistral': 457, 'n_tokens_neox': 424, 'n_words': 207}