Stateless Code | Codecast: Create a RubyGem 72: Add Basic Highest and Lowest Patterns @StatelessCode | Uploaded October 2021 | Updated October 2024, 1 hour ago.
This is the 72nd video in the NerdDice create a RubyGem series. In this video Mike starts adding in the advantage (highest) and disadvantage (lowest). This video focuses on the specific use case of rolling 2 dice and keeping the larger or smaller with the pattern roll_dN_with_advantage. Examples of the pattern:
roll_d20_with_advantage
roll_d20_highest (same as with advantage)
roll_d20_with_disadvantage
roll_d20_lowest (same as with disadvantage)
This video covers:
00:00:12 Introduction
00:01:37 Start adapting the spec for the roll_dN_with_advantage pattern
00:04:41 Adapt the module-level regular expression to make the first spec pass
00:05:39 Adapt the module-level regular expression to make the first spec pass
00:05:39 Write implement the pattern and get most of specs passing
00:08:49 Troubleshoot remaining spec failures in console and re-write specs to test for the problem in a different way
00:14:30 Adapt specs to for _highest use case
00:16:56 Modify ConvenienceMethods to give _highest the same behavior as _with_advantage
00:17:54 Adapt specs to for _with_disadvantage and _lowest use cases
00:21:08 Implement _with_disadvantage and _lowest together
00:24:30 Remediate RuboCop violations
00:25:52 Commit, push, update backlog
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
This is the 72nd video in the NerdDice create a RubyGem series. In this video Mike starts adding in the advantage (highest) and disadvantage (lowest). This video focuses on the specific use case of rolling 2 dice and keeping the larger or smaller with the pattern roll_dN_with_advantage. Examples of the pattern:
roll_d20_with_advantage
roll_d20_highest (same as with advantage)
roll_d20_with_disadvantage
roll_d20_lowest (same as with disadvantage)
This video covers:
00:00:12 Introduction
00:01:37 Start adapting the spec for the roll_dN_with_advantage pattern
00:04:41 Adapt the module-level regular expression to make the first spec pass
00:05:39 Adapt the module-level regular expression to make the first spec pass
00:05:39 Write implement the pattern and get most of specs passing
00:08:49 Troubleshoot remaining spec failures in console and re-write specs to test for the problem in a different way
00:14:30 Adapt specs to for _highest use case
00:16:56 Modify ConvenienceMethods to give _highest the same behavior as _with_advantage
00:17:54 Adapt specs to for _with_disadvantage and _lowest use cases
00:21:08 Implement _with_disadvantage and _lowest together
00:24:30 Remediate RuboCop violations
00:25:52 Commit, push, update backlog
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.