Share your repls and programming experiences

← Back to all posts
Cycle Risk Game!!

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

ChezCoder (1500)

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 (216)

@ChezCoder lol. wow it works. CHEATER jk jk

sortof

firefish (412)

@ChezCoder @JDOG787 This works: `go(0,1000)`

wulv (54)

@ChezCoder Even better hack:

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

This eliminates the possibility to lose

JosephSanthosh (1093)

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

HahaYes (1176)

I got 999 then I clicked 1 cycles and got destroyed :(

CodeLongAndPros (1254)

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 (1093)

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

Wilke000 (489)
``````<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Cycle Risk</title>
Wilke000 (489)

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

Wilke000 (489)

Again,

This is easy

install (5)

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

install (5)

Sorry, I'll check again

install (5)

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

install (5)

None of the codes work. Its a scam.

HerculukeZeEpic (190)

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.

firefish (412)

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

firefish (412)

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

JDOG787 (216)

@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 (39)

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

studentAlfredAl (464)

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 (439)

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

Warhawk947 (519)

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 (1176)

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

JDOG787 (216)

@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 (216)

@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 (216)

@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 (6457)

you can only store type `string` @Zuhdi28

ChezCoder (1500)

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

[deleted]
Coder100 (6457)

you mean `eval` :p @ChezCoder

ChezCoder (1500)

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

Coder100 (6457)

ye i made some tutorials @ChezCoder

JDOG787 (216)

@Coder100 look at discord pls :)

ChezCoder (1500)

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

JDOG787 (216)

@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 (1500)

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

DannyIsCoding (658)

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

RohilPatel (1065)

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 (216)

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

RohilPatel (1065)

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">`

RomanVannieuwen (2)

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