diff --git a/gallery/javascript-DiceRoll-rolls_a_dice/README.md b/gallery/javascript-DiceRoll-rolls_a_dice/README.md new file mode 100644 index 0000000..7573dee --- /dev/null +++ b/gallery/javascript-DiceRoll-rolls_a_dice/README.md @@ -0,0 +1,15 @@ +# Using JS along with Co-Pilot to write a Dice Roll Function + +A mere comment saying- `//this function rolls a dice` makes co-pilot understand what we want and it writes the code for us. + +The code- + + //this function rolls a dice + + function rollDice() { + return Math.floor(Math.random() * 6) + 1; + } + +For the live video open https://user-images.githubusercontent.com/67784844/140619338-33778342-9b5b-4480-a0ff-d1b1d3eb7ae1.mp4 + +