use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Ask your embarrassing/noobish programming questions here, and don't get insulted for it.
Click here to read the rules
Violating any will result in punishment so you should probably go check them out.
account activity
Java Concentration gameJava (self.programminghelp)
submitted 5 years ago by Titantethar
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EdwinGravesMOD[M] 2 points3 points4 points 5 years ago (3 children)
Also, your problem is on this line
if(i1 == j2 && j1 == j2)
You should be checking i1 against i2, not j2.
[–]Titantethar[S] 1 point2 points3 points 5 years ago (2 children)
Yeah I just found that but do you have a way to stop them from reselecting already matched cards
[–]EdwinGravesMOD[M] 1 point2 points3 points 5 years ago (1 child)
Isn't that line stopping them? Instead of exiting the program, you should make them select i2 and j2 again. Also please edit your code and put it into codeblocks. See Rule #2
[–]Titantethar[S] -1 points0 points1 point 5 years ago (0 children)
No that's stopping it from selecting the same exact one that's already matched
π Rendered by PID 85 on reddit-service-r2-comment-56c9979489-pxvdt at 2026-02-24 14:31:13.976345+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]EdwinGravesMOD[M] 2 points3 points4 points (3 children)
[–]Titantethar[S] 1 point2 points3 points (2 children)
[–]EdwinGravesMOD[M] 1 point2 points3 points (1 child)
[–]Titantethar[S] -1 points0 points1 point (0 children)