Skip to content
Sign upLog in
Profile icon

e a

@Hamburgr
sports
  • Budget Pokemon

    Cover page
    Made with Node.js
    Recent comments (0)
Repls
Community
Hamburgr
Hamburgr
shared a Post
1 year ago
3
Username and Password Database
I am currently working on an Account Creation and login form in c# because I am bored, however I have gotten stuck at one part. I have just started th
Smth in C# idrk
C#
johnnyfrancis
johnnyfrancis
wow what in the world is this? Z�\0\0\0\0\0\0\0�\0\0�\0\0\0\0\0\0\[email protected]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0�\0\0\0�\0� �!�L�!This program cannot be run in DOS mode. $\0\0\0\0\0\0\0PE\0\0L\0\0\0\0\0\0\0\0\0\0\0\0\0�\0 \0\0\0\0\0\0\0\0\0\0\0>$\0\0\0 \0\0\[email protected]\0\0\0\[email protected]\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0�\0\0\0\0\0\0\0\0\0\[email protected]�\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0�#\0\0K\0\0\0\[email protected]\0\0�\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\01 year ago
Coder100
Coder100
Two ways. Because this is an example project, consider using System.IO. Or, read this: https://docs.replit.com/misc/database1 year ago
Ascendancy
Ascendancy
I would suggest use Repl.it DB though I don't know about it's compatibility with C# (its a very clean system). If you want to store files permanently, you have to connect externally. Creating a database in C++/C# is somewhat of a daunting task for a novice programmer. I recommend you do your own research on C++ database programming or look at other languages like Python, Go, and Node that make the whole process extremely easy and doable with only a Repl.it.1 year ago
Hamburgr
Hamburgr
shared a Post
2 years ago
5
Hello Coders! Here is a template of code that I was lazy to finish. This code is based off a code by @Coder100 but in a different language. You can
Budget Pokemon
Node.js
Leroy01010
Leroy01010
cool!2 years ago
TsunamiOrSumth
TsunamiOrSumth
Nice!2 years ago
Coder100
Coder100
Awesome!!2 years ago
Hamburgr
Hamburgr
shared a Post
2 years ago
1
Hello Coders, In my code, I would like to add something such as crit-chance (Critical Chance) and miss-chance (Your chance of missing). Is there a wa
Budget Pokemon
Node.js
Coder100
Coder100
Sure! let critChanceProbability = 5; // 5% chance let missChanceProbability = 10; // 10% chance if (Math.random() * 100 + 1 == critChanceProbability) // just got a crit! if (Math.random() * 100 + 1 == missChanceProbability) // just got a miss! `2 years ago
RYANTADIPARTHI
RYANTADIPARTHI
Make a random function to perform your task.2 years ago
badst
badst
x=10; Math.floor(Math.random()*x); Assign x to anything you would like. Remember that if you choose 10, it'll return a random number between 0-9, not 10. You can fix this by changing x to 11 or adding 1.2 years ago
Hamburgr
Hamburgr
shared a Post
2 years ago
2
In my game, I am trying to add a command that if the user doesn't write a valid argument, it will replay the code. Currently, for the main startup for
Budget Pokemon
Node.js
Coder100
Coder100
Ok, so I would recommend you doing something like: console.log('A ' + enemyType + ' approaches!'); console.log('1. Attack') console.log('2. Run') var userOption = prompt('What would you like to do?: '); switch (userOption) { case "run": // code break; case "attack": // code break; default: console.log("invalid"); break; } You can read up on it here2 years ago
Coder100
Coder100
and no I am honored that people take inspiration :) 2 years ago
Coder100
Coder100
ok looking on to it2 years ago
Hamburgr
Hamburgr
shared a Post
2 years ago
3
Currently, I am experimenting with JS however, I am having a problem with my code. I want to make an if else statement that when the user says attack
Budget Pokemon
Node.js
Hamburgr
Hamburgr
@Coder100 @realTronsi @RYANTADIPARTHI Thanks for helping me out! However I have tried all of your answers and I am having a different but similar issue with all of them. Now, whenever I do attack, it shows the console.log statement for the run answer (Note: the run doesn't have any issues).2 years ago
Coder100
Coder100
Your if statement becomes: if ((userOption === 'Attack') || 'attack') { so that is always true because 'attack' is always true. Change your code to: var damageDealt = Math.floor((Math.random() * 10) + 1); console.log('A Challenger approaches!') console.log('1. Attack') console.log('2. Run') var userOption = prompt('What would you like to do?: ') if (userOption === 'Attack' || userOption === 'attack') { console.log('You chose to attack! You deal ' + damageDealt + ' damage!') } else if (userO2 years ago
RYANTADIPARTHI
RYANTADIPARTHI
You should do this: if (userOption === 'Attack' || userOption === 'attack'){ console.log('You chose to attack! You deal ' + damageDealt + ' damage!') } else if (userOption != 'Attack' || 'attack') { console.log('You ran away!'); } You are just putting ||, but not calling it again. 2 years ago
Hamburgr
Hamburgr
shared a Post
2 years ago
2
Currently, I am trying to try out making a website server to learn more about Javascript. I want to be able to prompt the user for questions and save
Trying to make a webpage
HTML, CSS, JS
Coder100
Coder100
Try this for your html: And for your js: let myVar = document.getElementById("myInput"); console.log(myVar); and you see it did save to myVar.2 years ago
RYANTADIPARTHI
RYANTADIPARTHI
The way to do it in js, is by prompts: var prompt_var = prompt("Prompt : ") /* You can check what they are saying by using if statements*/ if (prompt == "HI") { console.log("Said hi") } in HTML: That will just make a type box, where you can write.2 years ago
RayhanADev
RayhanADev
G’day @Hamburgr The easiest way to create this with Javascript would be to either: Use alerts: Javascript var prompt = prompt(‘What’s your name’); or to use input fields (bit more complex): HTML FILE Javascript var input = document.getElementById(‘myPrompt’).value Hope this helps! Cheers, ~ Ray <32 years ago