diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml new file mode 100644 index 00000000..64d7775e --- /dev/null +++ b/.github/workflows/contributors.yml @@ -0,0 +1,23 @@ +name: Add contributors +on: + schedule: + - cron: '20 20 * * *' + push: + branches: + - main + +jobs: + add-contributors: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: BobAnkh/add-contributors@master + with: + CONTRIBUTOR: '### Contributors' + COLUMN_PER_ROW: '6' + ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}} + IMG_WIDTH: '100' + FONT_SIZE: '14' + PATH: '/README.md' + COMMIT_MESSAGE: 'docs(README): update contributors' + AVATAR_SHAPE: 'round' diff --git a/1.number guess/app.js b/1.number guess/app.js new file mode 100644 index 00000000..74e878f0 --- /dev/null +++ b/1.number guess/app.js @@ -0,0 +1,32 @@ +let maximum = parseInt(prompt("Enter the maximum number!")); + +while(!maximum){ + let maximum = parseInt(prompt("Please enter valid number!")); +} +const targetNum = Math.floor(Math.random()*maximum)+1; + +console.log(targetNum); + +let guess = parseInt(prompt("Enter your first guess!")); +let attempts = 1; + +while(parseInt(guess)!== targetNum){ + if(guess == 'q') + break; + attempts++; + if(guess>targetNum) + { + guess = (prompt("Too high! Enter a new guess:")) + } + else{ + guess = (prompt("Too low! Enter a new guess:")) + } +} +if(guess=='q') +{ + console.log("OK, you quit!") +} +else +{ + console.log(`You got it! It took you ${attempts} guess`); +} diff --git a/1.number guess/index.html b/1.number guess/index.html new file mode 100644 index 00000000..bb2edb3e --- /dev/null +++ b/1.number guess/index.html @@ -0,0 +1,13 @@ + + +
+ + + +