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
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @FatBot! Please use /close or the Close Post button 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
h
h3d ago
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
FatBot
FatBotOP3d ago
FatBot
FatBotOP3d ago
or will prefere screenshot
FatBot
FatBotOP3d ago
No description
No description
h
h3d ago
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
FatBot
FatBotOP3d ago
yes im
h
h3d ago
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 ^^
FatBot
FatBotOP3d ago
do u have some yt videos i can see,
h
h3d ago
No description
FatBot
FatBotOP3d ago
im just confuses yes
h
h3d ago
Whats your background in java so far? First semester?
FatBot
FatBotOP3d ago
yes first semester how did u know it was danish
h
h3d ago
hvem ved
FatBot
FatBotOP3d ago
hahha
FatBot
FatBot3d ago
hug hvor sjovt
h
h3d ago
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://...
h
h3d ago
But I imagine your lectures and the ppts do cover most of these concepts
FatBot
FatBotOP3d ago
thx im kinda stupid so u are dansih danish
h
h3d ago
yup :okcool:
FatBot
FatBotOP3d ago
hvor studiere du selv hvad er chancen jeg er selv ude på ruc så har java på 3 semester
JavaBot
JavaBot3d ago
💤 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.

Did you find this page helpful?