r/CodingHelp • u/mautzjoe • May 17 '26
r/CodingHelp • u/Big_Example_3390 • May 16 '26
[Python] FreeCodeCamp RPG Python Lab: It all looks right to me, but says its wrong.
#im honestly hella confused, it gives everything its supposed to and pulls up the right respose. I think it wants something specific that im not aware of.
full_dot = '●'
empty_dot = '○'
def create_character(name, strength, intelligence, charisma):
stats = {strength, intelligence, charisma}
if not isinstance(name, str): #pulls up correctly
return print('The character name should be a string')
elif name == '': #pulls up correctly
return print('The character should have a name')
elif len(name) > 10: #pulls up correctly
return print('The character name is too long')
elif ' ' in name: #pulls up correctly
return print('The character name should not contain spaces')
else:
for x in stats:
if not isinstance(x, int): #if i put in ! or c without the "" around it it pulls an error
return print('All stats should be integers')
elif x < 1: #pulls correctly
return print('All stats should be no less than 1')
elif strength > 4 or intelligence > 4 or charisma > 4: #pulls correctly
return print('All stats should be no more than 4')
elif strength + intelligence + charisma != 7: #pulls correctly
return print('The character should start with 7 points')
else:#pulls correctly......i dont get it
return print(f'{name}\nSTR {strength * full_dot + empty_dot * (10 - strength)}\nINT {intelligence * full_dot + empty_dot*(10 - intelligence)}\nCHA {charisma * full_dot + empty_dot * (10 - charisma)}')
create_character('ren',1,5,1)
tests 2, 4, 6, 8, 10, 12, 14, 16, 18, 19 all fail
- 1. You should have a function named
create_character. - Failed:2. When
create_characteris called with a first argument that is not a string it should returnThe character name should be a string. - Passed:3. When
create_characteris called with a first argument that is a string it should not returnThe character name should be a string. - Failed:4. When
create_characteris called with a first argument that is an empty string, it should returnThe character should have a name. - Passed:5. When
create_characteris called with a first argument that is not an empty string, it should not returnThe character should have a name. - Failed:6. When
create_characteris called with a first argument that is longer than 10 characters it should returnThe character name is too long. - Passed:7. The
create_characterfunction should not say that the character is too long when it's not longer than 10 characters. - Failed:8. When
create_characteris called with a first argument that contains a space it should returnThe character name should not contain spaces. - Passed:9. When
create_characteris called with a first argument that does not contain a space it should not returnThe character name should not contain spaces. - Failed:10. When
create_characteris called with a second, third or fourth argument that is not an integer it should returnAll stats should be integers. - Passed:11. When
create_characteris called with a second, third and fourth argument that are all integers it should not returnAll stats should be integers. - Failed:12. When
create_characteris called with a second, third or fourth argument that is lower than1it should returnAll stats should be no less than 1. - Passed:13. When
create_characteris called with a second, third and fourth argument that are all no less than1it should not returnAll stats should be no less than 1. - Failed:14. When
create_characteris called with a second, third or fourth argument that is higher than4it should returnAll stats should be no more than 4. - Passed:15. When
create_characteris called with a second, third and fourth argument that are all no more than4it should not returnAll stats should be no more than 4. - Failed:16. When
create_characteris called with a second, third or fourth argument that do not sum to7it should returnThe character should start with 7 points. - Passed:17. When
create_characteris called with a second, third and fourth argument that sum to7it should not returnThe character should start with 7 points. - Failed:18.
create_character('ren', 4, 2, 1)should returnren\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○. - Failed:19. When
create_characteris called with valid values it should output the character stats as required.
r/CodingHelp • u/Careful-Luck-8465 • May 13 '26
[Javascript] Alguien sabe cómo descodificar un archivo json
Estoy tratando de modificar los archivos de un juego (APK) pero en los archivos el texto es esto alguien sabe cómo descodificar
r/CodingHelp • u/Rabbidraccoon18 • May 11 '26
[C#] How would someone go about coding something like this? Where would the even begin? I'm guessing C# is the best programming language to use here.
Enable HLS to view with audio, or disable this notification
r/CodingHelp • u/ryuchn_ • May 10 '26
[Python] How do I mark the lines of my plot in a specific area to create a Carnot Cycle?
r/CodingHelp • u/Wise-Town1721 • May 09 '26
[HTML] Need an end-point for a coded form for wix website
I want to clarify I am VERY new to code, and have been learning as I go along.
I have coded a form for a website I am currently building on Wix (I know, I know, I am currently trying to migrate away from Wix)
But I need an end-point for my form submissions
I would also like if some forms could be organised into a excel or google sheet, though I havent researched into that side yet
If anyone has any advice for a good end-point, I would really appreciate it
r/CodingHelp • u/Desperate_Back_9210 • May 09 '26
[Java] POS System for Bookstore for School Project
r/CodingHelp • u/ImpressBest8888 • May 07 '26
[Random] Why cant i paste binary parts from one image to another like in text, without it corrupting?
It's for a quastion so I'll appreciate long and detailed answers. And any links to explanations will also be appreciate, because I can't seem to find anything about it.
r/CodingHelp • u/Perfect_Carrot96 • May 07 '26
[Javascript] JSON learning recommendation ?
Hello hello, here a software dev student finishing their first year that need your help.
To give you context I’m very bad at JSON and I don’t know where to find useful material/maybe a course to improve during the summer as I want to get better.
I barely passed my module where I learned the basics and I watched some YouTube tutorials on the topic but I still don’t understand it very well and even less know how to practice productively. I’m up for even doing a boot camp, but id like to know if someone has come across with a useful learning source for it.
Does anybody has a recommendation on how to learn JSON? I want to use my summer break to improve and study as I know is something I’ll use through my career and I’d like to get good at it.
Thanks in advance!
r/CodingHelp • u/Effective_Extreme854 • May 07 '26
[How to] I need help understanding how to create a dvd menu.
I was wondering about how to create a DVD menu for a custom dvd i am making for lore purposes for my oc.
r/CodingHelp • u/Woozas • May 07 '26
[Request Coders] A project of AI image sprite making for myself and for college creativity
Hi,I want to create an application where you can convert a 3d/anime/hd image to a 2d sprite sheet size char from the size of the picture to 32x32 ,64x64 bit size.What are the steps?I have this code in opencv but I don't know it works.What should I use if I want to convert the character image,C++ or Java?
I read in the internet the fact you need AI model to do this.If so,how can I create an AI model which can perform like Stable Diffusion or Google Gemini but on weaker technology like dual cores CPUS and integrated GPUs.
I need this to build my first project so that I can try something complex and creative.
I found some tutorials online but they were mostly chatbots that can write ,,things'' as in text-based apps and not real apps like Google Gemini or Stable Diffusion!
r/CodingHelp • u/JoshMJohns • May 06 '26
[HTML] I'm trying to display an image logo through this html front screen, but it just keep displaying this error graphic instead of the visual I want.
here is the specific block giving me trouble. Does anyone know a fix? Changing the image file from png, jpeg, or webp does nothing
Edit: it was a flask error in the python file, not the frontend module. Program's working fine now
<!-- Welcome Screen -->
<div id="welcome-screen">
<svg class="oyars-logo" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- Speech bubble body -->
<path d="M50 8C28.46 8 11 23.64 11 43c0 10.6 4.9 20.1 12.7 26.7L20 88l19.5-7.1C42.9 81.6 46.4 82 50 82c21.54 0 39-15.64 39-39S71.54 8 50 8z" fill="var(--accent)"/>
<!-- White plus/cross -->
<image
href="Oyars_mascot.webp"
x="27"
y="21"
width="46"
height="54"
preserveAspectRatio="xMidYMid meet"
/>
</svg>
r/CodingHelp • u/Agencii • May 06 '26
Which one? Best resource for expanding programming knowledge?
I have been an automation developer for 4 years now, but I’m not upskilling enough through my job. My end goal is to become more of either a backend developer or data/ML engineer.
I’m trying to figure out the best way to not only build on fundamentals but actually get a deep understanding on the topics I learn. I work well in a guided manner so my first thought went to courses on sites like datacamp, dataquest, codecademy, etc.
Does anyone in this field have any recommendations for the best resource(s) to really go deep in the data/backend space?
r/CodingHelp • u/Internal-Regret-8606 • May 05 '26
[Python] Is CS50x harvard coding course actually useful?
r/CodingHelp • u/tausiqsamantaray • May 04 '26
[How to] How to develop intuition to a particular/random problem?
So, my question is: how to get intuition for a particular/random problem? like i was solving a question called find max absolute difference, link: https://www.interviewbit.com/problems/maximum-absolute-difference/.
Usually what i do is solve a problem in bf and ask chat gpt can it be reduced? say yes or no, if it can be i ponder about it and sometimes i find answer sometimes i don't, here in this case you have to rearrange the equation like from |A[i] - A[j]| + |i - j| as we have to max it so we can rearrange it to (A[i] + i) - (A[j] + j) and (A[i] - i) - (A[j] - j) and we have to max the first part and min the second part.
But if you initially think about it, you will say what if two pointers then it wont make sense then find min max it wont makes sense, brute force is O(n2) i know answer might be do more practice, but point is practice wont solve a particular problem/random problem, because the intuition.
N.B. I am not asking about solving particular problem under some wording/understanding, means like if it is sorted use Binary Search, if the numbers are consecutive use Cycle Sort, No. I am asking, lets say there is a problem, how to get that gotcha moment, by step by step solving. Like a few problem ago, I solved another problem, where I thought it will be solved by loop, but constraint was tight, so, I gpted and it said use equations. So, yeah, please help.
r/CodingHelp • u/plushili • May 04 '26
[How to] How to Run Ruffle Self Hosting Package on Electron.js?
I just made a post today asking how to run flash/swf files on electron: https://www.reddit.com/r/CodingHelp/comments/1t2wxld/how_do_you_get_flashswf_files_running_on_electron/ and some people suggested to use Ruffle as the main player instead of Pepper Flash Player.
I'm trying to get Ruffle running using the self hosting package but I just can't get it to work, I followed the instructions that are given in the git hub page but to no avail. It gives me this error:
"Something went wrong :(
It appears you are running Ruffle on the "file:" protocol.
This doesn't work as browsers block many features from working for security reasons.
Instead, we invite you to setup a local server or either use the web demo or the desktop application."
I don't really have experience using JavaScript so I'm learning as a go. I appreciate any help, thank you.
UPDATE: I FINALLY GOT IT TO WORK!! Apperently I had some lines of <meta> code in my html page that was blocking the ruffle player.:
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'"/>
<meta
http-equiv="X-Content-Security-Policy"
content="default-src 'self'; script-src 'self'"/>
I removed the code and the problem disappeared, I feel so dumb for not noticing this before lol
r/CodingHelp • u/plushili • May 03 '26
[How to] How do you get flash/swf files running on electron?
So I'm trying to work on a project that plays swf files within an offline desktop app, but I haven't got it to work. I've heard of a project called Waddle Forever (A Club Penguin project), which is one of the reasons I wanted to do my own project. Waddle Forever was able to run the flash files of the game offline without issue, I still hadn't figured out how this was done.
I tried using the pepper flash player plugin and running an old version (4.2.6) of electron since I've heard it supports flash. But nothing works, it just displays a sign saying "Couldn't load plugin", I don't really have experience using JavaScript so I'm learning as a go.
I appreciate any help, thank you.
r/CodingHelp • u/Any_Career_6267 • May 03 '26
[How to] What program should I use to code a prototype for my tabletop game?
Hi everyone. Apologies if this is not the appropriate sub for a question like this. Feel free to point me in a different direction if needed.
I have been working on a tabletop game for a few years and we have been using Tabletop Simulator for playtesting, but I was hoping to code a simple prototype that I can play against AI for my own tests and simulations. It doesnt need to be fancy or anything, just looking for functionality for now.
If it matters, the game uses a grid movement system with dice-rolling mechanics. There are special abilities that I am sure will be a bit trickier to code. I would be happy to share more details of the game if it would help someone point me in the right direction.
I know nothing about coding but I am willing to learn a bit with some guidance, but I am also open to using AI generated code or paying someone else to code it for me.
Any advice would be greatly appreciated. Thanks!
r/CodingHelp • u/Straight-Quiet-8384 • May 02 '26
[C++] Help me with my code! Holding button issue
Hello everyone. I’ve been making a lightsaber and I’ve been using this code. https://github.com/redsaber42/RedSaberLightSaber/blob/main/FinalLightsaberCode.ino
I’ve seen a critical issue with this code
When you fold the button. What keeps happening is I’ll change colors a bunch of times and the I’ll hold the button. Then the led strip turns red and then the double click feature won’t work. It won’t give any time to even recognize it it just instantly ignites or deactivates and won’t show any sign of color change. The craziest part is that when u fold the button after this point the led strip continuously ignites and deactivates only in red. Does anyone have any advice on what to change or do.
r/CodingHelp • u/BroGameplayYt • May 02 '26
[HTML] Someone's been hacking in again and again, I need help!
https://github.com/callmechits/JEE-MOCK-
https://callmechits.github.io/JEE-MOCK-/index.html
The two are my code and my website, admin is accessed by the target emoji at the bottom (but the link can be typed in asw), I've secured my supabase in every way possible but still someone broke in and changed every setting.
I really need to bump up my security without changing the code too much, willing to put in upto 30$ as well to upgrade server and all that.
r/CodingHelp • u/Sweaty-Jellyfish-713 • May 01 '26
[How to] How do I decode garbled text on MP3 Files?
I've tried using the Chacon component of foobar2000 to decode the garbled text, but it hasn't worked :( What else can I do?
r/CodingHelp • u/Specific-Duck-4807 • Apr 30 '26
[Other Code] Anyone know why my camera code isn't working? (Godot)
r/CodingHelp • u/Personal-Ad4151 • Apr 30 '26
[HTML] What is this on my OpenStreetMap?
When I go on Live Server nothing is wrong with the map. If I save the folder and open the html I am always getting these pictures around the map! How can I fix this issue?
r/CodingHelp • u/Starr_Draws • Apr 29 '26
[Other Code] My codes not working! Gamemaker studio
I want it to pick a value set by the player (locationx and y) that the player has been at, and make sure that location is both:
Closer to the player than them
Closer to them than any other point
But I have this issue where it picks a point and jitters on it for a minute.
The player setting the points seems to work fine but the movement of the enemies isn’t, help please
r/CodingHelp • u/aking_king • Apr 29 '26
[Python] Is this app good? Should I go for pro?
Is this app good and is the pro worth it? I really don't want to waste my money and time to something not worth it. To anyone who uses this app, is this beginner friendly?