r/programmingrequests • • Nov 08 '24

Slots machine game in HTML for school

3 Upvotes

my school blocked everything so now i wanna make a suite of gambling games that won’t be blocked because it’s stored locally lol.

i’ve made a game that functions with chatgpt but when i want specific requests chatgpt just breaks the game so now im asking for

An animation and a pull lever for the slot machine where it scrolls like a casino with variation, a shop with lots things to buy and everything you buy the value goes up every minute or so and you can sell them and make more money, some nauseating effects when you drink or smoke weed and maybe some hotboxing smoke effect over the whole screen when you smoke, food with hunger and regular drinks for thirst, it doesn’t have to look good insanely good but if you can by all means go ahead, if you want to promote yourself or credit yourself in the work that’s fine just don’t make it super obnoxious, instead of a browser dialog box everything you win something make it a window within the game. and the level to pull/spin should work just by pressing enter, also add an option to buy casinos and start a business and those make you money as time goes. that’s all for now i hope someone can do it. it can just be a simple game no crazy stuff but if you wanna make it nice you can, also don’t limit yourself to HTML if you don’t want to. it’ll be interesting to see what you guys come up with thanks.

this is my chatgpt generated code

<!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Vlad's Slot Machine</title> <link href="https://fonts.googleapis.com/css2?family=Bungee+Inline&display=swap" rel="stylesheet"> <style> body { font-family: 'Bungee Inline', sans-serif; display: flex; flex-direction: column; align-items: center; background-color: #111; color: #fff; margin: 0; padding: 20px; height: 100vh; justify-content: center; overflow: hidden; } h1 { font-size: 3em; color: #FFD700; margin-bottom: 20px; } #balance { font-size: 1.5em; margin: 10px 0; } #slot-machine { display: flex; justify-content: center; gap: 20px; padding: 20px; background-color: #333; border: 4px solid #FFD700; border-radius: 10px; } .reel { width: 80px; height: 80px; background-color: #222; border: 2px solid #555; overflow: hidden; position: relative; display: flex; justify-content: center; align-items: center; font-size: 2em; color: #FFD700; } #spin-button { padding: 10px 20px; font-size: 1.5em; margin-top: 20px; cursor: pointer; background-color: #FFD700; border: none; color: #111; } #store { margin-top: 30px; text-align: center; font-size: 1.2em; } .item { margin: 10px; display: inline-block; padding: 10px; border: 2px solid #FFD700; border-radius: 8px; cursor: pointer; color: #FFD700; transition: background-color 0.3s; } .item:hover { background-color: #FFD700; color: #111; } #drunk-level, #high-level, #cars-owned, #mansions-owned { margin-top: 20px; font-size: 1.5em; } </style> </head> <body>

<h1>Vlad's Slot Machine</h1>
<div id="balance">Balance: $<span id="currency">50000</span></div>
<div id="slot-machine">
    <div class="reel" id="reel1">7</div>
    <div class="reel" id="reel2">7</div>
    <div class="reel" id="reel3">7</div>
</div>
<button id="spin-button" onclick="spin()">Spin ($5)</button>

<div id="store">
    <h2>Store</h2>
    <div class="item" id="item-bear">🍺 Bear - $50</div>
    <div class="item" id="item-vin">🍷 Vin - $50</div>
    <div class="item" id="item-marryjuana">🍃 MarryJuana - $50</div>
    <div class="item" id="item-car">🚗 Car - $50,000</div>
    <div class="item" id="item-mansion">🏰 Mansion - $100,000</div>
</div>

<div id="drunk-level">Drunk Level: <span id="drunk">0</span></div>
<div id="high-level">High Level: <span id="high">0</span></div>
<div id="cars-owned">Cars Owned: <span id="cars">0</span></div>
<div id="mansions-owned">Mansions Owned: <span id="mansions">0</span></div>

<script>
    // Initialize variables
    let balance = parseInt(localStorage.getItem('balance')) || 50000;
    let drunkLevel = 0;
    let highLevel = 0;
    let carsOwned = 0;
    let mansionsOwned = 0;

    const balanceDisplay = document.getElementById('currency');
    const drunkDisplay = document.getElementById('drunk');
    const highDisplay = document.getElementById('high');
    const carsDisplay = document.getElementById('cars');
    const mansionsDisplay = document.getElementById('mansions');

    balanceDisplay.textContent = balance;
    drunkDisplay.textContent = drunkLevel;
    highDisplay.textContent = highLevel;
    carsDisplay.textContent = carsOwned;
    mansionsDisplay.textContent = mansionsOwned;

    // Slot symbols
    const symbols = ['7', '🍒', '🍋', '🍉', '⭐'];

    // Reel elements
    const reel1 = document.getElementById('reel1');
    const reel2 = document.getElementById('reel2');
    const reel3 = document.getElementById('reel3');

    // Function to randomly select a symbol with higher chances for "7"
    function randomSymbol() {
        const odds = Math.random();
        if (odds < 0.4) return '7'; // Higher chance for "7"
        return symbols[Math.floor(Math.random() * symbols.length)];
    }

    // Spin function
    function spin() {
        if (balance < 5) {
            alert("Insufficient funds!");
            return;
        }
        
        // Deduct spin cost
        balance -= 5;
        updateBalance();

        // Set random symbols with animation effect
        reel1.textContent = randomSymbol();
        reel2.textContent = randomSymbol();
        reel3.textContent = randomSymbol();

        // Check result after a delay
        setTimeout(checkWin, 300);
    }

    // Check for a win condition
    function checkWin() {
        if (reel1.textContent === '7' && reel2.textContent === '7' && reel3.textContent === '7') {
            balance += 1500; // Win $1,500 if all three are "7"
            alert(`You win $1,500!`);
            updateBalance();
        }
    }

    // Update balance display and save it
    function updateBalance() {
        balanceDisplay.textContent = balance;
        localStorage.setItem('balance', balance);
    }

    // Store item purchase function
    function buyItem(item) {
        if (item === 'Car' && balance < 50000) {
            alert("Not enough money to buy this car.");
            return;
        }
        if (item === 'Mansion' && balance < 100000) {
            alert("Not enough money to buy this mansion.");
            return;
        }
        if (item !== 'Car' && item !== 'Mansion' && balance < 50) {
            alert("Not enough money to buy this item.");
            return;
        }

        // Adjust balance and update items based on purchase
        balance -= (item === 'Car' ? 50000 : item === 'Mansion' ? 100000 : 50);
        if (item === 'Bear') {
            drunkLevel += 5;
            drunkDisplay.textContent = drunkLevel;
        } else if (item === 'Vin') {
            drunkLevel += 10;
            drunkDisplay.textContent = drunkLevel;
        } else if (item === 'MarryJuana') {
            highLevel += 10;
            highDisplay.textContent = highLevel;
        } else if (item === 'Car') {
            carsOwned += 1;
            carsDisplay.textContent = carsOwned;
        } else if (item === 'Mansion') {
            mansionsOwned += 1;
            mansionsDisplay.textContent = mansionsOwned;
        }

        alert(`You bought ${item} for $${item === 'Car' ? '50,000' : item === 'Mansion' ? '100,000' : '50'}!`);
        updateBalance();
    }

    // Attach click events to store items
    document.getElementById('item-bear').onclick = () => buyItem('Bear');
    document.getElementById('item-vin').onclick = () => buyItem('Vin');
    document.getElementById('item-marryjuana').onclick = () => buyItem('MarryJuana');
    document.getElementById('item-car').onclick = () => buyItem('Car');
    document.getElementById('item-mansion').onclick = () => buyItem('Mansion');

</script>

</body> </html>


r/programmingrequests • • May 19 '23

Project help: scraping data

3 Upvotes

I have a project I need help with! I have zero knowledge about coding, so my apologies if this isn't super clear:

Basically, I have an Excel sheet of Record Numbers and need to find their correlating URL in the Record Locator. Ultimately I will copy and paste that URL onto the Excel sheet. The order of operations is:

Search the Record Number in the Record Locator.

Click "edit".

Inside the file, click "view published".

A new webpage loads.

Copy URL.

Return to file.

Click "Finding Aid Data".

Paste the URL in the indicated field.

Save.

I have done 1200 files by hand, and I have 1000 left. Redditors have suggested I use Python and Selenium to scrape the website for the data I need and then export it to a CSV file. It'd be amazing if I could upload a CSV file to the program of all my record numbers so I could batch download the data.

Does any of this make sense? haha


r/programmingrequests • • Mar 16 '23

need help Code to copy twitter bookmarks with Inspect element?

3 Upvotes

Disclaimer: Not a programmer here, just an slight enthusiast

So I have used before a line of code to unlike tweets, simply by going to the liked tweets, inspect element, console and then:

setInterval(() => { for (const d of document.querySelectorAll('div[data-testid="unlike"]')) { d.click() } window.scrollTo(0, document.body.scrollHeight) }, 1000)

Is there something similar that can be done from Inspect to copy bookmarks?


r/programmingrequests • • Mar 10 '23

Scrape some data off a webpage and put it in a google sheet

3 Upvotes

I'm looking to track my stats on the web-based game geoguessr, but I'm getting sick of putting the stats into an excel sheet manually.

From the page geoguessr.com/me/profile, I want to pull the current competitive rating, and all of the information under the statistics tab.

No clue how I'd go about this, thanks in advance

Ideally via a firefox tampermonkey script or something else non-invasive


r/programmingrequests • • Mar 07 '23

solved✔️ Monitoring *.ini for specific changes

3 Upvotes

I need a program which monitors an INI file for two setting values. The setting values are under the sections:
[BlockStation_1]
[BlockStation_2]

The setting value under each section is:
CoolTime=30000

The minimum value allowed per our SOP is 30000. If the value is higher than 30000 I don't care. I do not want the value to be anything under 30000.

I would like the program to be ran at startup by windows, which I can do. It should run as a background process ideally monitoring the file in real-time if possible. When it detects that either of the CoolTime variables is under 30000 it pops up an Always On Top window that displays an alert along the lines of "The Cool Down time has been set below the minimum allowable value" and is only closable with a password. If the [not closable] thing is possible, then a separate monitoring process which will keep opening the always on top window if it gets closed without the password.

Willing to pay.

OS is windows 7 and 10


r/programmingrequests • • Mar 03 '23

An mobile app that will be very useful to Pureland Buddhists

3 Upvotes
  • I tried using chatGTP to generate code in visual Studio but I got bunch of errors and gave up.

  • Basically a mobile app that simply speech recognizes the recitations/chantings and count upward. So if someone chants/recites "Namo Amida Butsu" 3 times it'll count 3 times if they say it 1000 times it'll count 1000 times.

  • Bonus 1: Different chants in different languages would just be text change for example "Namo Amituofo" for Chinese or "Nam Mô A Di Đà Phật" in Vietnamese.

  • Bonus 2: Allow user to input their own mantra for it to recognize for example if someone wanted to change "Om Mani Padme Hum" (tibetan) they can type that in and it'll count how many times they say it.

I don't imagine this would be too hard for someone who build any kind'a of mobile app before which I did but it's been like more than a decade and I am dumb as a rock now.

  • I want mobile because hoping that their speech recognition is better then JS web app.


r/programmingrequests • • Jan 08 '23

Moonbase Alpha Sheet music editor

3 Upvotes

There are a very few cover songs on youtube that have been made using the tts system from the videogame Moonbase Alpha. The tts is similar if not identical to Stephen Hawkings. There are not enough of these songs, and i want more goddamnit. Im pretty sure the biggest reason there are so few is that they are time consuming to make. I want a program that basically translates sheet music and lyrics into what im calling "moonbase-esse" (The syntax neccessary to make the tts sing), and then hands you the audio for playback or download. Im not even sure if this is the right subreddit for a request like this. Its a very silly project, and i need it to feel joy.


r/programmingrequests • • Dec 16 '22

need help Coin Flip Android App

3 Upvotes

So I play MTG, I play a coinflip deck, I would like an app that is just this but in portrait mode.
Krark's thumb being a toggle that when active means that I have this card/effect active so I need the flips the app does to reflect that.
And if we could cut the "Flip 'til Success" button that would be great. Artwork in background also isn't needed. would honestly prefer like a minimalist dark mode theme for it.

TLDR I need an app with 4 buttons, one that flips a coin, one that flips x coins x being a human input, one that flips a coin until failure, and the final one being a toggle for the rest of the buttons where it will allow every flip to be 2 and ignore the losing one. it doesn't even need to be a heads/tails coin it can just be loss/win coin or 0/1 coin.

Thank you in advance! And idk if it would help but that premade one that works in the picture is on a table top simulator public table


r/programmingrequests • • Oct 19 '22

Javascript Support science and help your favorite charity by participating in a short online experiment.

3 Upvotes

Hi

We are researchers from the University of Zurich, Switzerland, and developed a web application experiment for investigating ways to improve code review. If you have javascript knowledge, please help us in this 20 – 30 minutes experiment by using the desktop version of a browser: https://review.ifi.uzh.ch/

To thank you, we will donate 5 USD to the charity of your choice.

We are very grateful if you share the link with colleagues and make them aware of this study.

Thank you very much,

Lukas and researcher team


r/programmingrequests • • Oct 02 '22

I need this driver made compatible with a Raspberry Pi Pico. I want to use Micro-Python in my project and the microchip I plan to use seems to require this driver. If I'm wrong or missing something please let me know. Thanks in advance!

Thumbnail ti.com
3 Upvotes

r/programmingrequests • • Jul 10 '22

Modding / Changing firmware of Ehx 22500 looper pedal

3 Upvotes

Hey! I have no idea how possible this is, but I use the 22500 loop pedal a bunch. But I would love to be able to sync the pedal through an analog sync signal. The pedal has a footswitch input that accepts commands through standard foot switch input. It also has a function that allows you to tap the tempo. So I don't think it should be too much of a stress to allow for the footswitch input to accept a rhythm sync signal that ties directly to the tap tempo. I dunno. You can find the firmware here: https://www.ehx.com/support/?_download=22500#Product-Downloads

If you think this a possible project give me a heads up, I can even pay a small fee if necessary.


r/programmingrequests • • May 12 '22

Language Could anyone help me with a physical list of the possibilities of my old phones lock screen pattern with the given information?

3 Upvotes

It's an Android phone using the 3x3 number grid

(Like this):

1 2 3

4 5 6

7 6 9

and there should be either 5 or 6 nodes used (and each can only be used once). I'm like 90% sure that it either A) starts in one of the 4 diagonal corners (1, 3, 7, 9) and goes diagonal inward to 5 and I'm also pretty sure that it goes continues through 5 to the other side (as in 1, 5, 9 or 3, 5, 7)

Or B) Starts at 5 and goes diagonal outward towards 1, 3, 7, or 9.

I'm like 99% sure that there's never any up or down all three columns (as in, no 147, 741, 256, 652, 369, or 963)

I also think it spanned all three lines (as in, a whole row/column can't be counted out)

Idk how possible this is to calculate but another person asked a similar question on here which is why I'm asking as well (idk if my situation would be different though)

Thanks for any help!!


r/programmingrequests • • Apr 14 '22

Solved✔️ Simple farming timer for videogame crops

3 Upvotes

Hello, I'd like a simple timer for video-game crops/plants, which I would use for Wizard101. Can be either for computer or phone, given how simple it is.

+ Basic interface where you input your character names (in case if you have multiple), along with what they have planted. Example: Monica - outdoor potato plantation and indoor tomato; Alura - indoor peas.

+ Ability to add custom plants and define how long they grow. Example: Potato grows 40 min and peas grow ~4 hours. So if 1 hour had passed you would see potato as ready, but peas as less than 25% progress. User would have to specify the length of each growth stage themselves.

+ Button to restart timer once you have harvested crops and replanted them.

+ Tooltip for each plant listing growth stage: seed, sprout, mature, elder. When a plant reaches next stage, the timer stops and requires user to manually click to resume it. This is because plants can remain in sprout stage or mature stage indefinitely and never reach elder stage even after 2 years, due to how Wizard101 is coded (plant data is not updated unless player visits their garden). Once player has visited their garden and saw plants reach next stage, click the button to resume timer.

+ Button to skip to a certain growth stage (in case if you made error prior).

+ Ability for timer to work offline and when computer is off. It would update its clock based on computer time. For example potato grows 8 hours, but you turned off pc halfway in. Then turned pc on after 6 hours. Program would automatically update potatoes as ready, because 10 hours had passed (initial 4 + 6 after catching up with pc time).


r/programmingrequests • • Apr 02 '22

need help Program that can pick out ASIN from recently added in Amazon search, take it and run it through a website that compared it to the other Amazon sites and send a message if the price is lower than others

3 Upvotes

So I was wondering if that is possible in a reasonably easy way? Say for example taking the recently added in an Amazon search, taking the ASIN and running it through a site like Hagglezon or something similar, seeing if the price is lower in my specific region of Amazon and then returning the product link.

I tried looking it up but with no programming background outside of early Java, I could barely start before I got stuck.

https://www.youtube.com/watch?v=vvbPeL5R6nQ

This video talks about something similar.


r/programmingrequests • • Mar 24 '22

need help Looking for a program/script that will create a new Asana task in a certain section when a Todoist task is created in a certain section

3 Upvotes

Hi! I'm looking for help coding a program or script that will take a ton of heavy lifting off my shoulders. Before anyone comments, yes, I've tried all of the online sync tools like Power Automate, Zapier, and Automate.io. They give me basics, but not enough details on the Todoist side to do what I want.

Basically, here's what I'm thinking of...

In Todoist, I have work projects broken down by section. If a task with no due date is created in a section called Status, then it should sync that to a matching project section in Asana. My trouble here has been 2-fold...

  1. All the online services make me link a specific TD project to a Asana project, which makes sense, except that I have over 50 projects, and can't realistically make a link for each one. I would need a way to dynamically set the target project per task as it runs.

  2. The online services don't allow me to filter or trigger by tasks created in a certain section.

FWIW, both services offer fairly robust RESTful API's, so it at least shouldn't be too bad to do what's needed. Any help is greatly appreciated!

Todoist API

Asana API


r/programmingrequests • • Mar 17 '22

Discord bot A bot to find existing discord accounts based on usernames alone, without the need to search for the # + 4 digits

3 Upvotes

Hi, i recently lost contact with a friend on discord who kinda dissapeared. My only lead is the discord username of someone who knows this friend IRL, but not the 4 digit # code. I could try find the username by trying all 9999 possible #???? combinations via sending friend requests but this would take forever.

Is it possible to create some sort of program/bot that tests every #???? combination by attempting 9999 friend requests?


r/programmingrequests • • Feb 24 '22

need help Creating game accessibility software for people with a physical disability

Thumbnail
docs.google.com
3 Upvotes

r/programmingrequests • • Jan 15 '22

need help Script request, Could someone create a script that would open three incognito tabs in firefox?

3 Upvotes

Could someone create a script that would open three incognito tabs in firefox?


r/programmingrequests • • Jan 09 '22

Something similar to Maven for Arduino?

3 Upvotes

Is there something similar to Maven or package.json for an Arduino environment?

Thank you in advance.


r/programmingrequests • • Dec 21 '21

BBC Basic to Visual Basic

3 Upvotes

Who can help me convert a BBC basic Script to an simple Exe ?

The BBC basic script is simple as it reads an template file, adjusts two lines in the template and writes it as a new file to disk with date details as the file name.

Jan=1

Feb=2

Mar=3

Apr=4

May=5

Jun=6

Jul=7

Aug=8

Sep=9

Oct=10

Nov=11

Dec=12

Now$=TIME$

Per%=INSTR(Now$,".")

Comma%=INSTR(Now$,",")

Len%=LEN(Now$)

Day$=LEFT$(Now$, (Per%-1))

Date$=MID$(Now$, (Per%+1), (Comma%-Per%-1))

ToD$=RIGHT$(Now$,(Len%-Comma%))

Colon%=INSTR(ToD$,":")

H%=VAL(LEFT$(ToD$, (Colon%-1)))

ToD$=MID$(ToD$, (Colon%+1))

Colon%=INSTR(ToD$,":")

M%=VAL(LEFT$(ToD$, (Colon%-1)))

ToD$=MID$(ToD$, (Colon%+1))

S%=VAL(ToD$)

Space%=INSTR(Date$," ")

Day%=VAL(LEFT$(Date$, (Space%-1)))

Date$=MID$(Date$, (Space%+1))

Space%=INSTR(Date$," ")

Month%=EVAL(LEFT$(Date$, (Space%-1)))

Date$=MID$(Date$, (Space%+1))

Year%=VAL(Date$)

PRINT Now$'"¦";Day$;"¦";H%;"¦";M%;"¦";S%;"¦";Day%;"¦";Month%;"¦";Year%

WAIT 200

SrcFile$=Day$+".ply"

DstFile$=STR$(Year%)+"_"

IF Month%<10 DstFile$=DstFile$+"0"

DstFile$=DstFile$+STR$(Month%)+"_"

IF Day%<10 DstFile$=DstFile$+"0"

DstFile$=DstFile$+STR$(Day%)

InCh%=OPENIN(SrcFile$)

INPUT #InCh%, FirstLine$, SecondLine$

SecondLine$=RIGHT$(SecondLine$,(LEN(SecondLine$)-1))

FLMkr%=INSTR(FirstLine$,Day$)-1: FLMkl%=LEN(FirstLine$)-FLMkr%-LEN(Day$)

SLMkr%=INSTR(SecondLine$, Day$)-1: SLMkl%=LEN(SecondLine$)-SLMkr%-LEN(Day$)

PRINT "* First line of source file:";FirstLine$;"*"'"* Second line of source file:";SecondLine$;"*"

FilePath$=LEFT$(FirstLine$,FLMkr%)

Space%=INSTR(FilePath$," ")

Len%=LEN(FilePath$)

FileName$=RIGHT$(FilePath$,(Len%-Space%))

FileTimeSuffix$=RIGHT$(FirstLine$,FLMkl%)

PlaylistPath$=LEFT$(SecondLine$,SLMkr%)

PlaylistSuffix$=RIGHT$(SecondLine$,SLMkl%)

FileName$=FileName$+DstFile$+FileTimeSuffix$

FirstLine$=FilePath$+DstFile$+FileTimeSuffix$

SecondLine$=PlaylistPath$+DstFile$+PlaylistSuffix$

PRINT "Changed to:"'FirstLine$'SecondLine$

PRINT "Checking File Existance [";FileName$;"]"

F% = OPENIN(FileName$)

IF F% CLOSE #F%

IF F% > 0 THEN

PRINT "["FileName$"] Already Exists Skipping Writing Playlist File and Exiting"

WAIT 200

QUIT

ELSE

OutCh%=OPENOUT(FileName$)

PRINT "Opening [";FileName$;"]", OutCh%

PRINT#OutCh%, FirstLine$

BPUT#OutCh%, 10

PRINT#OutCh%, SecondLine$

BPUT#OutCh%, 10

REPEAT

BPUT#OutCh%, BGET#InCh%

UNTIL EOF#InCh%

CLOSE#OutCh%

CLOSE#InCh%

ENDIF

ENDIF

WAIT 500

QUIT

i would like to change it so it can be triggered from Windows scheduler and after doing its thing simply closes....


r/programmingrequests • • Oct 18 '21

Request for automated search and email program

3 Upvotes

Hi! I'm new to this, but am looking for some help and direction :)

I want a simple program that will automate a search. Let's say for example "grocery stores in South Dakota".

And I want the same automated email sent to the email addresses found on those websites.

Is this possible?

(Its not for marketing purposes. Its. Genuine need to semd inqueries for information from multiple places.)


r/programmingrequests • • Sep 28 '21

need help 16 bit dos game programming

3 Upvotes

i need assistance with making a 16 bit dos game

https://github.com/sparky4/16
I am wondering if anyone is interested in working with open watcom C 2.0 and Inline assembly.

we have a bunch of test programs but nothing fruitful as there is no game engine.
if your remotely interested please let me know


r/programmingrequests • • Aug 26 '21

Simple Structured Wiki

3 Upvotes

Given any kind of simple data set, create a CRUD editor where the create, update and delete actions are only suggested edits. An admin interface should exist to compare versions and accept or reject suggested edits.

Preferably in nodejs/react but I'm open minded.


r/programmingrequests • • Aug 26 '21

Would someone please make this

3 Upvotes

I have an idea of a program that needs to be made. If it is not too difficult, does anyone want to give it a try?

A program that takes crypto currency amount and calculates how much the various exchanges charge to transfer or convert to various addresses. Maybe just deal with the major ones like crypto.com, binance.com, etc. Of course, maybe it already exists, but I do far haven't found it.

I hope this is the right sub to post this.

Thanks for any response you send.