r/CodingForBeginners • • 14d ago

This seems like a good forum to post in c:

1 Upvotes

This is the program. I built it off of a couple for loops and some array tinkering Although, it is working properly, I'd like to be able to type the suit of the card along with the number. AI has helped me a little bit, but the idea of how the cards are displayed in the array is my idea.

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

// creation of the deck

ArrayList<String> deck = new ArrayList<>();

String[] suits = {"Hearts", "Diamonds", "Clubs", "Spades"};
String[] ranks = {
"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"
};

//Generation of the 52 cards

for (int i = 0; i < suits.length; i++) {
for (int j = 0; j < ranks.length; j++) {
deck.add(ranks[j] + " of " + suits[i]);

}
}

// Shuffle the deck

Collections.shuffle(deck);

// creaation of the card grid

//2D array

String[][] cards = new String[3][3];
String table[][] = {

{"?", "?", "?"},
{"?", "?", "?"},
{"?", "?", "?"}};
boolean[][] drawn = new boolean[3][3];

// Place 9 random cards into the grid
int cardIndex = 0;

for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cards[i][j] = deck.get(cardIndex);
cardIndex++;

}
}
int totalDraws = 0;
System.out.print("=== DRAW A CARD GAME ===");

// Game Loop
while (totalDraws < 9) {
System.out.println("\nYour card table:");

//Display the table\
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(table[i][j] + "\t");
}
System.out.println();
}
System.out.print("\nChoose a card (1-9 and put the suit)");

int choice = scanner.nextInt();

// Validate choice

if (choice < 1 || choice > 9) {
System.out.println("Choose a number between 1 nd 9!");
}
// Convert choice into row and column

int row = (choice - 1) / 3;
int column = (choice - 1) % 3;

// Check if card was already drawn

if (drawn[row][column]) {
System.out.println("You already drew that card!");
continue;
}
// Reveal the card
table[row][column] = cards[row][column];

drawn[row][column] = true;

totalDraws++;

System.out.println("You drew: " + cards[row][column]);
}
System.out.println("\n===== Game Over ======");
System.out.println(("You drew all 9 cards"));

scanner.close();
}
}

Original code looks a little bit like this; there was some more to it, but that's the jist of it.

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        String[][] twoDarray = {
                {"x", "x", "x"},
                {"x", "x", "x"},
                {"x", "x", "x"}
        };

        Scanner scanner = new Scanner(System.
in
);

        System.
out
.print("Enter something: ");
        String userinput = scanner.nextLine();

        twoDarray[0][0] = userinput;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.
out
.print(twoDarray[i][j] + "  ");
            }

            System.
out
.println();
        }

        scanner.close();
    }
}

r/CodingForBeginners • • 15d ago

Help please

5 Upvotes

Hi, I'm someone that has been falling in and out of coding for multiple years now. Purely just because I have no idea where to even start or what platform is trustworthy and actually teaches you things. So, I very desperately need advice about where I should even begin to learn and what platform I should go to. I have not gone to youtube videos yet because one I also don't know where to go for youtube videos, so suggestions for channels I could learn from would also be very helpful. And two I would like to first get behind the keyboard myself and actually experience what it's like to code. To see if I actually like it before I fully commit.​ And would like only free websites. Because I don't wanna pay for anything just yet. Just in case I end up hating it entirely.

If it's any help at all, I am interested in becoming a graphic designer someday. So, web design would be very helpful to me. And I would very much like how to code games. If theres even a difference between the two. Anyway, thank you for reading my post and commenting if you did. I hope you have a good day.


r/CodingForBeginners • • 15d ago

What are the biggest things people are missing out on with their GitHub Education/Student accounts?

0 Upvotes

Hi everyone, what are some of the biggest things that most students with a GitHub Education/Student Developer account don't realise they have access to (either free or discounted), and which have actually been extremely useful for you and other people?

Feel free to tell me anything: from technical things that are important for developers, to vibe-coding with AI agents, to tutorials that teach beginners the fundamentals, etc.


r/CodingForBeginners • • 16d ago

Beginner in Python coding, and coding in general, confused

9 Upvotes

Hi, I am learning python, and as a complete noob/beginner, from Kaggle courses. But I have hit the issue that I can't seem to understand what lines to write next, which command-thing to use, when to use them, i can't seem to remember. Any tips?


r/CodingForBeginners • • 16d ago

Beginners friendly app developing meet up groups?

3 Upvotes

Hi,

I recently got into developing an app as a hobby, and I'm not familiar with computer coding at all. I thought it would be fun if there were a group that gets together, maybe on weekday evenings or weekends, to facilitate and help members make their own apps. Since I'm in SF, I think there should probably be one in the area, but I don't know where to look. Any suggestions?

Thanks!


r/CodingForBeginners • • 16d ago

Help

1 Upvotes

As a newbie learning python I would like to ask .......Everything I don't know how to start I know I can watch online guides and all but I need advice fr well its all about financial problem and I am afraid I will rush and waste my time while not learning efficiently pls help.


r/CodingForBeginners • • 16d ago

I am in 1st sem. Feeling very overwhelmed. Everyone around me has coding experience from school but idk anything rn. I have started learning python from codewithharry playlist. How should I move further? What is dsa and cp? How and when to start? Also everyone is participating in hackathons and doin

2 Upvotes

Title


r/CodingForBeginners • • 16d ago

Day 6 Learning Python

4 Upvotes

So far so good. This time around I had to freelance this code all from memory. Definitely ran into some walls and tripped along the way but I introduced the time function and made a neat little count down at the end. if you run the code yourself, you'll see the 1 second delay between each number that gets displayed before the goodbye message.

import time


space_station_name = "OrionStation"
station_current_oxygen_level = 100
station_current_food_level = 50



def consume_supply(current, used):
    return current - used


def gain_supply_food(current, gain):
    return current + gain


def show_status(station_name, oxygen_level, food_level):
    print("SpaceStation:", station_name)
    print("OxygenLevel:", oxygen_level)
    print("FoodSupply:", food_level)



station_current_oxygen_level = consume_supply(station_current_oxygen_level, 30)
station_current_food_level = consume_supply(station_current_food_level, 15)
station_current_food_level = gain_supply_food(station_current_food_level, 25)



show_status(space_station_name, station_current_oxygen_level, station_current_food_level)



print("This computer will self destruct in:")
print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
print("goodby")

r/CodingForBeginners • • 16d ago

Having trouble getting back into it.

6 Upvotes

So I started trying to learn code with a the video the Bro Code

A 12 Hour Video Python Full Course For Free

I got into it due to my brother in law getting a job from self taught coding and has been successful.

Now for someone as autistic as me with potential ADHD like traits, I can't focus, I can't remember what notes or why these lines of code mean. So it's either I get bored or overwhelmed.

I mostly want to do it to just try and make a simple game for steam.

I don't know what's wrong with me and I want to gain support in this difficult journey.


r/CodingForBeginners • • 16d ago

Thoughts on using AI to learn coding?

0 Upvotes

I don’t mean full on vibe coding, I mean using AI to learn how to code something that would take hours of watching videos and struggling normally, and you write the code instead of the AI and it helps with troubleshooting and stuff


r/CodingForBeginners • • 17d ago

new to coding someone please suggest me what to do, currently learning html from YouTube apia collage channel

3 Upvotes

r/CodingForBeginners • • 18d ago

Beginner in coding, starting with python

12 Upvotes

I'm a beginner in coding and want to start with python first, so in what manner should I start.


r/CodingForBeginners • • 17d ago

Can someone give me a opinion about project I am working on?

Thumbnail
github.com
1 Upvotes

Planning to get some upgrades if it is worth to keep working on


r/CodingForBeginners • • 18d ago

Can I do it?

0 Upvotes

I have one year of experience and I want to travel to Armenia, but I don't have the money. I will start studying programming and try to save some money to provide a simple and peaceful life in Armenia. I currently live in Sudan. Please advise me. Thank you


r/CodingForBeginners • • 18d ago

Starting My App Development Journey at 26 – Looking for Advice

5 Upvotes

Hi everyone, I'm 26 years old and currently learning how to build my own apps. Any tips on what I should learn first or where I should start?


r/CodingForBeginners • • 19d ago

Looking for the basic python course (obviously good) but in hindi for my friend

Post image
6 Upvotes

My friend is looking for a python course from basics, but his English is weak he can't understand or having the problem to fully understand in English language so please suggest a good course where instructions are in Hindi


r/CodingForBeginners • • 19d ago

I want to start learning about computer coding; where should I begin?

6 Upvotes

.


r/CodingForBeginners • • 19d ago

getting started

1 Upvotes

hello I'm an I.T student on my second semester of second year so I've been thinking of trying to start like a part time web dev I've been studying java script and i heard of "react" they said that's what you need if you want to be a web dev.

Questions:

  1. Anything else i need to learn before trying to go into this?
  2. where/how do i start this part-time Web development?
  3. just an extra question. how do you use Ai as a "tool" exactly heard it a lot of times.

r/CodingForBeginners • • 20d ago

Backend for an app

2 Upvotes

Please suggest me how do I learn backend ....i am new to everything right now . I have basic knowledge of python .


r/CodingForBeginners • • 20d ago

Today I Learn OOP

3 Upvotes

It's Quite Confusing....

😵‍💫😵‍💫😵‍💫

Any Tips....

I Learn C++ OOP


r/CodingForBeginners • • 20d ago

Am I stupid or something?

8 Upvotes

I'm a first year programming student and I have 0 background in coding, recently our professor has been teaching us python and java but when they teach ite I don't understand a thing like I'm just copying the code they're making and that's it but when I ask ai to help explain it to me and stuff I manage to make codes without looking up templates on them and although sometimes/often times it doesn't work Im actually learning. Like am I stupid? Why can't I learn these from my own professors who have their masters/doctorates in it.

Pardon my grammar English ain't my first language.


r/CodingForBeginners • • 20d ago

Python Study Notes

Thumbnail drive.google.com
2 Upvotes

Hey I made some Python notes that cover some important introductory topics. Let me know if there are some python classes/libraries that would be helpful to cover.


r/CodingForBeginners • • 21d ago

Coding Tutor (Python, C/C++) for beginners

6 Upvotes

Hey everyone! If you’re an absolute beginner trying to learn how to code, I’d love to help you out. I know there are a ton of online courses out there, but I've seen mamy beginners lose motivation. That is usually where people quit, and that is where I come in.

Think of me more like a coding coach. I have a degree in Computer Science. I used to work as a lead instructor at a coding academy for young students, so I am patient and know how to break down complex stuff into simple steps. I try to make it fun.

I can teach you Python, C, C++, etc. Just let me know.

Shoot me a DM if interested!


r/CodingForBeginners • • 22d ago

How to learn coding ??

64 Upvotes

Hello everyone!

I'm a complete beginner who wants to learn coding and programming from the very basics to an advanced level within the next six months.

I would really appreciate your suggestions on:

  1. How should I start learning coding as a complete beginner?
  2. Which programming language should I learn first?
  3. What are the best free websites, YouTube channels, or courses to learn coding?
  4. How should I practise coding regularly and improve my problem-solving skills?
  5. Are there any good platforms where beginners can practise coding and work on projects?
  6. What learning roadmap would you recommend for someone starting from zero?

My goal is to develop practical programming skills, build real-world projects, and eventually become a professional programmer.

If you have experience in coding or know any good resources, courses, communities, or learning strategies, please share your recommendations.

Thank you!