Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Gallery- Javascript-DiceRoll #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions gallery/javascript-DiceRoll-rolls_a_dice/README.md
Original file line number Diff line number Diff line change
@@ -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