ENDERFUN
ENDERFUN
JCHJava Community | Help. Code. Learn.
Created by Pong on 1/28/2025 in #java-help
Tiles in a 2d Java game
And what exactly do you aim to achieve?
26 replies
JCHJava Community | Help. Code. Learn.
Created by Pong on 1/28/2025 in #java-help
Tiles in a 2d Java game
Could you explain why it wont work?
26 replies
JCHJava Community | Help. Code. Learn.
Created by Pong on 1/28/2025 in #java-help
Tiles in a 2d Java game
Like 120 4 10 8 1 2 5 12
26 replies
JCHJava Community | Help. Code. Learn.
Created by Pong on 1/28/2025 in #java-help
Tiles in a 2d Java game
Can't you just use numbers over 9?
26 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
how to solve this without loops at all
Yea that's right, I haven't noticed the last sentence
15 replies
JCHJava Community | Help. Code. Learn.
Created by ENDERFUN on 1/27/2025 in #java-help
Serious problems with Maven
The most probable cause is my mistake in <build> part of pom
63 replies
JCHJava Community | Help. Code. Learn.
Created by ENDERFUN on 1/27/2025 in #java-help
Serious problems with Maven
So one of those things is definetly a culprit
63 replies
JCHJava Community | Help. Code. Learn.
Created by ENDERFUN on 1/27/2025 in #java-help
Serious problems with Maven
Well, after deleting the whole <build> tag from pom.xml, auto-service dependencies and all pieces of code including it the compilation works like a charm
63 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
how to solve this without loops at all
It'd be something like this:
public static int count11(String str) {
if (str.length() < 2) return 0;
if (str.startsWith("11")) return 1 + count11(str.substring(1));
return count(str.substring(1));
}
public static int count11(String str) {
if (str.length() < 2) return 0;
if (str.startsWith("11")) return 1 + count11(str.substring(1));
return count(str.substring(1));
}
15 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
how to solve this without loops at all
@LinusHuck in the assignment it looks like count can only take one parameter
15 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
how to solve this without loops at all
And when substring is of length 1 you terminate recursion by returning 0
15 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
how to solve this without loops at all
You can call the count11 with let's say substrings and when it starts with "11" you return 1 + count11(11) or count11() otherwise
15 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
java question about strings
Done
14 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
java question about strings
Guess uumm #share-knowledge is for that right?
14 replies
JCHJava Community | Help. Code. Learn.
Created by ENDERFUN on 1/27/2025 in #java-help
Serious problems with Maven
Sure
63 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
java question about strings
I'd love to elaborate, but maybe somewhere else
14 replies
JCHJava Community | Help. Code. Learn.
Created by ENDERFUN on 1/27/2025 in #java-help
Serious problems with Maven
(Don't comment me on overdose of stream api)
63 replies
JCHJava Community | Help. Code. Learn.
Created by asdru on 1/27/2025 in #java-help
have two different projects open on intellij
From my experience, if you're using maven, you can create a mutli-module project. I dunno if it's good or not, but it's sufficient
8 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
java question about strings
Yeah, in most cases sure. The only instance when it's straight up wrong is when you want to parse http request with binary body and you need to find \r\n\r\n (speaking from experience)
14 replies
JCHJava Community | Help. Code. Learn.
Created by SidKid on 1/27/2025 in #java-help
java question about strings
To elaborate a bit: The answer is: depends. In 98% of situations you'd want to just use String, but there are some rare occasions where String just won't cut it (f. ex. socket programming, which I've been fighting with for 2 weeks or JNI). But unless you'd want to do something stupid with Java, String class is all you would ever need
14 replies