press tab at the start of each line
or there is the
```
language
```
I think that is what you are asking about.
press tab at the start of each line
or there is the
```
language
```
I think that is what you are asking about.
Yes that is exactly what I'm asking about. I just want to copy and paste the code from visual code to the window and have it look more clean than having to tab my way.
Peakd has that standard in the editor, just click 1 button then paste your code. Glad I could help.
Really? I'm going to have to check that out for the next post in this little game series... You interested in helping on this? Need maps, characters, NPCs, shops, I'm only one person lol.
I will be reading for sure, if I can catch on to how it works maybe. I do need practice with making stuff work together, so helping out with small parts here and there would be good for me. I am quickly learning it is easy for me to get in over my head at this point.
You want me to give you something to work on? How about a grid map in javascript? 10 x 10.... you can lay it out and give it to me even without the javascript. I will need coordinates though. 0,0 for the center. It will allow me to focus on characters and logging in.
lol not yet, I wouldn't even know where to start on that. err well I guess its just 2 variables with random ++ or -- numbers assigned, and constrained by +10 or -10. I have no clue how to do 0 as center with an even number on the x or y axis. It would work out to 11x11 or 9x9 unless I am missing something. (Most likely)
+5 and -4 would be 10x10 actually!
ffs fine I will go read something and maybe reply soon....
sorry about the rambling reply, lmao just typed it as I was thinking.
Edit: random doc links
! [secrets defiantly not more mistakes java edition]
[import java.until.random}>(https://www.geeksforgeeks.org/generating-random-numbers-in-java/)
VS Code says type script IDK why I missed you said javascript.// Generate random integers in range 0 to 10
int r1 = r.nextInt(10);
int r2 = r.nextInt(10);// Printing random integers
System.out.println("Random Integers: " + r1);
System.out.println("Random Integers: " + r2);
this editor doesn't have the code block button, and ya the constant tab over is tedious
ps TIL the > is how people do that line on the side thing and spoilers require a > on empty lines to include the next block.
window.gameMap = {};
for (let y = 0; y < 10; y++) {
for (let x = 0; x < 10; x++) {
const key = ${x},${y}
;
let desc = "";
if (x === 5 && y === 5) {
desc = "You arrive at the central plaza...";
} else if (y === 0) {
desc = "To the north lies a jagged cliff...";
} else if (x === 0) {
desc = "A thick forest lines the western edge...";
} else if (x === 9 || y === 9) {
desc = "Here the land fades into shadows...";
} else {
desc = `A quiet patch of land at coordinates (${x}, ${y}).`;
}
window.gameMap[key] = desc;
}
}
I don't remember, but for - integers in java it would have to be a float, or is that just in C?
the line : "public static void main" may just be throwing me off and making me think of (int main void) from that Harvard cs50 class.
Edit: just being dumb java is 32 bit integer limit both + and -
Ok I gave it a decent shot for a couple hours, and missed the mark bigtime. No promises but I may jack with it over the next couple days to see if I can figure it out.
Give me whatever you got in a few days and I'll clean it up. I do suggest plugging your code into chatgpt to see where you're missing the mark. That way you don't need to worry about asking anyone.