Java 2d array and classes help
im in this situation that i cant really find a yt video on that subject, i have 2 classes on to desrcribe the cell and a class that show each cell into a 2d grid, i dont know how make 2 classes interact with eachother.
22 Replies
⌛ This post has been reserved for your question.
Hey @FatBot! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Maybe you can show what code you have so far and how you're processing it.
A good approach to solving this is going step-by-step.
- First see if you can make a 10x8 grid
- then see if you can populate it like it describes - with 55 trees and all the rest
- then see if you can go over it again and make 12 of the trees be burning trees
- and so on
this is how far im
or will prefere screenshot


mixing danish and english 🤨
So whats your thought process behind it? at first you do manage to populate all the cells - so youre at the first step - all the cells have the same state
oh also
yes im
you are creating an array within the for loop - which means you never actually populate the array you have as a field in the class Kort
that array just dissappears - so right now you are actually not populating it ^^
do u have some yt videos i can see,

im just confuses
yes
Whats your background in java so far? First semester?
yes
first semester
how did u know it was danish
hvem ved
hahha
hug hvor sjovt
There's not really any video to see since this is mostly fundamental java - you can watch a similar video on the topic if it helps you
https://www.youtube.com/watch?v=jzCxywhTAUI&pp=ygUhdHV0b3JpYWwgc2ltcGxlIGNoZXNzIGluIGphdmEgY2xp
RyiSnow
YouTube
How to Code Chess in Java
I coded chess in Java and this is how I did it.
It looked simple enough but boy, it was much more complicated than I thought! I was surprised at how much you can learn by coding this little old game.
You can download the chess piece images in the video from here:
https://ryisnow.itch.io/pixel-art-chess-piece-images
About Game Loop:
https://...
But I imagine your lectures and the ppts do cover most of these concepts
thx
im kinda stupid so u are dansih
danish
yup :okcool:
hvor studiere du selv
hvad er chancen
jeg er selv ude på ruc
så har java på 3 semester
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.