Share your repls and programming experiences

← Back to all posts
Cycle Risk Game!!
JDOG787 (155)

Hi everyone

I made this cool game! I made this because I just recently learned frontend js so to practice I made this game!

How to play!

  • Try to get 200 1000 cycles by pressing buttons
  • Be careful. Theres a chance you will lose all
  • NEW: Better win/lose ratios
  • NEW: Uses localStorage

Enjoy :)

Commentshotnewtop
ChezCoder (1460)

paste this in console:

function win(){score=1000;cycles.textContent = score + " Cycles";cycles.textContent = "Yay You Won! You Got 1000 Cycles!"};function setscore(scr){score=scr;cycles.textContent = score + " Cycles";if(score === 1000){cycles.textContent = "Yay You Won! You Got 1000 Cycles!";playbtn.style.display = "block";}};console.log("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\033[4m\033[3m\033[32mSuccess!\033[0m");function spam(btnId,amnt){if (btnId/btnId!=1){return 'Btn number has to be between 1-5';}var int_val_ = setInterval(()=>{if (score <= amnt) {document.getElementsByClassName("btn"+btnId)[0].click();}else{clearInterval(int_val_);}},10);scrollTo({top:0,behavior:"smooth"});}function removeRandom(){Math.random = function random(){ return 0 };console.log("Code given by @wulv")}

Commands:
win() - ruin the fun
setscore() - set the score; example: setscore(30)
spam() - spam a button; example: spam("1",10) will spam the first button until the score reaches 10
removeRandom() - removes the possibility to lose (thanks @wulv!).

JDOG787 (155)

@ChezCoder lol. wow it works. CHEATER jk jk

sortof

wulv (47)

@ChezCoder Even better hack:

Math.random = function random(){ return 0 };

This eliminates the possibility to lose

JosephSanthosh (76)

CHECK OUT MY POST
Python FAST and EASY Tutorial PART 1
@ChezCoder

CodeLongAndPros (915)

I would say:

1 -> 1/100
5 -> 1/20
10 -> 1/10
20 -> 1/5
50 -> 1/2

To make the risk/reward equal

JosephSanthosh (76)

CHECK OUT MY NEW POST!!!
Python FAST and EASY Tutorial PART 1
@CodeLongAndPros

Wilke000 (346)
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Cycle Risk</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
  </head>
Wilke000 (346)

Change title from <title>repl.it</title> to <title>Cycle Risk</title>

Wilke000 (346)

Again,

This is easy

install (4)

This works.<def count=100><count.button=fale>

install (4)

Sorry, I'll check again

install (4)

Wait. I think THIS is it <count=false><count tick=1000 def error><804def/point>

install (4)

None of the codes work. Its a scam.

HerculukeZeEpic (180)

cool!
Is it okay if I kind of copy the idea for a python code?
I won't use cycles as the Risk, and I will link you in the description.

johnstev111 (256)

What? Fix this please: @JDOG787


Also in the console: I did this: it works: go(0,1000)

johnstev111 (256)

@JDOG787 What did you fix? the difference between the numbers 200 and 1000? or the code...

JDOG787 (155)

@johnstev111 I made it so it doesn't say Yay you won! You got 200 cycles! but it says Yay you won! You got 1000 cycles! was that the problem?

nikilS (3)

Great! Keep up the good work :D

HZLPY (21)

Aw... I also made a cycles thing and it didn't get noticed ._.

studentAlfredAl (390)

Lol, based on the current posts on cycles, this is pretty good :)

LucasGonzalez19 (0)

i copy your game but i did it in python. here is the link if anyone wants to take a look but is in spanish
https://repl.it/join/tjlmpogj-lucasgonzalez19

Jakman (329)

It seems that these cycle games are going to become popular. I presume these will be dead by June.

Warhawk947 (509)

Pro Strategy: Click the +50 button twice until you get 100 cycles,
then click the 20, 10, 5, 1, 1, 5, 10, 20, 50

IN THAT ORDER!

HahaYes (893)

uh oh... I knew these cycle games were coming....

JDOG787 (155)

@HahaYes lol. theres always been cycle games

[deleted]

Just a tip:
Make the goal higher(recommended 1000 to make it longer and fun!)
And you can use localStorage cuz if the user needs ro rest, closes the phone or computer and he will back with the same score! Ask @NoelBryan if you need him to help you with localStorage

JDOG787 (155)

@Zuhdi28 thx for the tip. i didnt want to make it to high but if its not then i will make it higher. and lll look into localStorage :) thx

JDOG787 (155)

@Zuhdi28 also does it need to be a server to use local storage?

[deleted]

@JDOG787 np😉

[deleted]

@JDOG787 defined all the time:

localStorage.setItem("thenameoftheitem", functionorvariable)

Enjoy😉

[deleted]

@JDOG787 np :D

Coder100 (3041)

you can only store type string @Zuhdi28

ChezCoder (1460)

@Coder100 yeah but a work around would be to use exec later on

ChezCoder (1460)

@Coder100 yea, also do u have experience with repl auth?

Coder100 (3041)

ye i made some tutorials @ChezCoder

JDOG787 (155)

@Coder100 look at discord pls :)

ChezCoder (1460)

@Coder100 oh well i dont read tutorials (xD) can u help me with something related to replauth?

JDOG787 (155)

@Zuhdi28 ok I added the local storage and 1000 cycles goal. @NoelBryan thx for the help with localStorage. :)

[deleted]

@JDOG787 cool!

[deleted]

javascript is cool

yes?

And also good job!

[deleted]

@JDOG787 np, YAY!

ChezCoder (1460)

hmm... time to make an exploit >:)

DannyIsCoding (492)

If you spam the 50 cycles key you can win pretty easily. Nice game!

RohilPatel (799)

Ok, a few things. 1. It didn't say I won. Very minor, but you should make it if >= 100. Also, line 8 index.html, use & instead of the & sign. Idk why html is picky

JDOG787 (155)

@RohilPatel thx for the feedback. but wdym by &?

RohilPatel (799)

In the url, if u see an & sign, just do this: & @JDOG787

I got u: replace line 8 with this:

<link href="https://fonts.googleapis.com/css2?family=Poppins&amp;display=swap" rel="stylesheet">

JDOG787 (155)

@Warhawk947 thx I fixed the problem

RomanVannieuwen (2)

It's really a cool idea of balancing the cycle buttons.