eternalxlks / IdeasPlease-

Please list some ideas on repositories, because I have a brainfart....and the ideas GitHub give are TRASH!
Other
1 stars 0 forks source link

Programming Ideas (Ranked from Absolute Beginner To Godly) #1

Open Brunozhon opened 4 days ago

Brunozhon commented 4 days ago

Programming Ideas

Absolute Beginner

  1. Print Your Name: A program that simply prints "Hello, [Your Name]!" to the console.
    name = "eternalxlks"
    print(f"Hello, {name}")
  2. Simple Addition: Take two numbers as input and print their sum.
  3. Favorite Color Prompt: Ask the user for their favorite color and respond with, "Wow, [Color] is a great choice!"

Super Beginner

  1. Count to Ten: Print the numbers 1 through 10 using a loop.
    for i in range(1, 11):
    print(i)
  2. Odd or Even: Ask for a number and say if it’s odd or even.
  3. Greet the User: Prompt for a name and display a personalized greeting.

Real Easy

  1. To-Do List App: A simple app to add, edit, and delete tasks with priority tags.
    
    tasks = []

while True: print("\nTo-Do List:") for i, task in enumerate(tasks, start=1): print(f"{i}. {task}")

print("\nOptions: [1] Add Task  [2] Remove Task  [3] Exit")
choice = input("Choose an option: ")

if choice == "1":
    task = input("Enter a task: ")
    tasks.append(task)
elif choice == "2":
    task_num = int(input("Enter task number to remove: "))
    if 1 <= task_num <= len(tasks):
        tasks.pop(task_num - 1)
elif choice == "3":
    break
else:
    print("Invalid choice!")
10. **Random Quote Generator**: Fetch and display random quotes using an API or a local database.
11. **Basic Calculator**: A graphical or console-based calculator supporting basic operations.

## Easy
12. **Weather App**: Fetch weather data from an API and display it based on user input for location.
13. **Unit Converter**: Convert between units like temperature, length, and weight.
14. **Tic-Tac-Toe Game**: A simple 2D game with a basic AI opponent.
```python
board = [' ' for _ in range(9)]

def print_board():
    for i in range(0, 9, 3):
        print(f"{board[i]} | {board[i+1]} | {board[i+2]}")
        if i < 6:
            print("--+---+--")

def check_winner():
    wins = [(0, 1, 2), (3, 4, 5), (6, 7, 8),
            (0, 3, 6), (1, 4, 7), (2, 5, 8),
            (0, 4, 8), (2, 4, 6)]
    for a, b, c in wins:
        if board[a] == board[b] == board[c] != ' ':
            return True
    return False

player = 'X'
for turn in range(9):
    print_board()
    move = int(input(f"Player {player}, choose a spot (1-9): ")) - 1
    if board[move] == ' ':
        board[move] = player
        if check_winner():
            print_board()
            print(f"Player {player} wins!")
            break
        player = 'O' if player == 'X' else 'X'
    else:
        print("Spot taken, try again!")
else:
    print("It's a draw!")

Medium

  1. Expense Tracker: Log and categorize expenses, providing charts for insights.
  2. Chat Application: A local or online chat app using WebSocket or a similar protocol.
  3. Maze Generator and Solver: Create random mazes and solve them algorithmically.
    
    import random

def generatemaze(size): maze = [[random.choice([' ', '#']) for in range(size)] for _ in range(size)] maze[0][0] = 'S' # Start maze[size-1][size-1] = 'E' # End return maze

def print_maze(maze): for row in maze: print("".join(row))

def solve_maze(maze, x, y, path): if x < 0 or y < 0 or x >= len(maze) or y >= len(maze) or maze[x][y] in ('#', '*'): return False if maze[x][y] == 'E': path.append((x, y)) return True

maze[x][y] = '*'
path.append((x, y))

if (solve_maze(maze, x+1, y, path) or
    solve_maze(maze, x-1, y, path) or
    solve_maze(maze, x, y+1, path) or
    solve_maze(maze, x, y-1, path)):
    return True

path.pop()
return False

Generate and solve a maze

size = 5 maze = generate_maze(size) print("Generated Maze:") print_maze(maze)

path = [] if solve_maze(maze, 0, 0, path): print("\nMaze Solved! Path:", path) else: print("\nNo solution found.")


## Hard
18. **Custom Programming Language**: Design and implement a basic interpreter for a toy language.
```python
def evaluate(command):
    # Your implementation of SimpleLang should go here.
    return "Not implemented"

def interpret(command):
    try:
        print(evaluate(command))
    except Exception as e:
        print(f"Error: {e}")

print("SimpleLang Interpreter. Type 'exit' to quit.")
while True:
    cmd = input(">> ")
    if cmd.lower() == "exit":
        break
    interpret(cmd)
  1. Stock Price Predictor: Use machine learning to predict stock trends based on historical data.
  2. 2D Platformer Game: Create a game with custom physics, animations, and levels.

Insane

  1. Distributed File System: Design a fault-tolerant system to store files across multiple machines.
  2. Multiplayer Online Game: Create a real-time multiplayer game with server-side logic.
    
    # file: server.py
    #
    # DISCLAIMER: This game only focuses on sending chat messages. Feel free to expand on top of it! This is code for the server file.

import socket import threading

clients = []

def broadcast(message, sender_socket): for client in clients: if client != sender_socket: try: client.send(message) except: clients.remove(client)

def handle_client(client_socket): while True: try: message = client_socket.recv(1024) broadcast(message, client_socket) except: clients.remove(client_socket) client_socket.close() break

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(("0.0.0.0", 5555)) server.listen()

print("Server is running...") while True: client_socket, client_address = server.accept() print(f"Connection from {client_address}") clients.append(client_socket) threading.Thread(target=handle_client, args=(client_socket,)).start()

```python
# file: client.py
#
# Handles the client for the game.

import socket
import threading

def receive_messages(client_socket):
    while True:
        try:
            message = client_socket.recv(1024).decode("utf-8")
            print(message)
        except:
            print("Disconnected from server.")
            break

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("127.0.0.1", 5555))

threading.Thread(target=receive_messages, args=(client,)).start()

print("Connected to server. Type your messages below.")
while True:
    message = input()
    client.send(message.encode("utf-8"))
  1. AI Dungeon Master: Build an AI capable of running D&D-like campaigns with dynamic storytelling.

Godly

  1. Minimal Operating System Kernel: Build a basic kernel that can handle process management, memory allocation, and simple I/O.
    
    ; file: boot.asm
    ;
    ; The bootloader for the OS. Figuring out process management and memory allocation is left as an exercise to the reader.

[BITS 16] [ORG 0x7C00]

start: mov ax, 0x07C0 add ax, 288 mov ss, ax mov sp, 4096

mov si, msg
call print_string

mov bx, 0x1000  ; Load kernel to memory location 0x1000
mov ah, 0x02
mov al, 1
mov ch, 0
mov dh, 0
mov cl, 2
int 0x13

jmp 0x1000

print_string: mov ah, 0x0E .repeat: lodsb cmp al, 0 je .done int 0x10 jmp .repeat .done: ret

msg db "Booting the OS...", 0

times 510 - ($-$$) db 0 dw 0xAA55

```c
// file: kernel.c
//
// The kernel for the operating system. Process management and memory allocation should be written here (ideally).

void print_string(char* str) {
    unsigned short* video_memory = (unsigned short*)0xB8000;
    while (*str) {
        *video_memory++ = (*str++ | 0x0F00); // White text on black background
    }
}

void main() {
    print_string("Hello, OS World!");
    while (1); // Infinite loop to keep the OS running
}
# Build the OS by running these commands.
nasm -f bin boot.asm -o boot.bin
gcc -ffreestanding -m32 -c kernel.c -o kernel.o
ld -m elf_i386 -Ttext 0x1000 --oformat binary kernel.o -o kernel.bin
cat boot.bin kernel.bin > os_image.bin
qemu-system-x86_64 -drive format=raw,file=os_image.bin
  1. Custom Bootloader: Create a bootloader that initializes hardware and loads your operating system.
  2. Filesystem Implementation: Design and implement your own filesystem with features like file creation, reading, and writing.
  3. Graphics Driver Development: Write a graphics driver to enable a basic GUI environment for your operating system.
  4. Network Stack: Implement a network stack to enable basic communication using TCP/IP.
Brunozhon commented 4 days ago

To be honest, I'm around "Insane". You should definitely return to "Godly" after ~a few~ several years of knowledge of C.

eternalxlks commented 4 hours ago

Oh well, thank you! @brunozhon!

eternalxlks commented 4 hours ago

@The-Bruno-Store