#How can I write this cleaner?
25 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @worn root! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
- make it an array ffs how many times do i have to tell you
- loop through the array and count how many have cyan backgrounds, then check if that number is >= 2
and count the elements with the specified colour
How can I count how many CYAN backgrounds have?
loop, check, increment variable
like this?
have them already be an array
ive told you this so many times already
bahnhofN - bad
bahnhofs[i] - better
you should not have those bahnhof1 at all
Yeah I now but thats to late now
no it isn't
and it wouldn't have been if you had just used arrays from the start
also, use camelCase methods, not snake_case
you're here every so often asking for code review, when it's all just mostly the same issue. numbered variables. you'd think you'd learn by now
also, you can just use background++;
thats helpfull thx