Skip to content

Instantly share code, notes, and snippets.

View ANUPAMCHAUDHARY1117's full-sized avatar

Anupam Chaudhary ANUPAMCHAUDHARY1117

View GitHub Profile
const request = require("request");
function getTheUrl(data) {
var options = {
url: "https://jsonplaceholder.typicode.com/posts/" + data
}
return options
}
function consoleTheResult(url) {
const onHit = (state) => ({
hit : () => {
if(state.chances === 0){
return console.log("Game is over");
}
state.chances -= 1;
state.goalsScored += 1;
}
});
const onHit = (state) => ({
hit : () => {
if(state.chances === 0){
return console.log("Game is over");
}
state.chances -= 1;
state.goalsScored += 1;
}
});
class Player {
constructor(name){
this.name = name;
this.goalsScored = 0;
this.chances = 10;
}
hit(){
if(this.chances === 0){
return console.log("Game is over");
const onHit = (state) => ({
hit : () => {
if(state.chances === 0){
return console.log("Game is over");
}
state.chances -= 1;
state.goalsScored += 1;
}
});
class Player {
constructor(name){
this.name = name;
this.goalsScored = 0;
this.chances = 10;
}
hit(){
if(this.chances === 0){
return console.log("Game is over");