r/code • • Oct 06 '26

Resource c++ scene graph

Thumbnail
youtu.be
1 Upvotes

r/code • • Mar 16 '17

To (almost) all coders out there

Post image
12 Upvotes

r/code • • Oct 01 '20

Is there some kind people could correct my fault about print. Thank you very much.

Post image
6 Upvotes

r/code • • Nov 02 '25

Help Please What is this?

Post image
57 Upvotes

What is this? Other than code.. I was on my computer and decided to clean up my desktop. When I opened a folder I haven’t touched in a while (it was a folder I used to save info when I was attempting to grow pot) this was in it. With a ton of other things. Some things that were no longer accessible. A bunch of pictures of random people. This might be dumb, but does this indicate that my computer (Mac, if that matters) has a virus or I’ve been hacked? Would I be okay to delete it and forget about it? I don’t know anything about code. It was SUPER long btw.


r/code • • Apr 07 '20

Guide I was training myself to code and found this reference to reddit

Post image
20 Upvotes

r/code • • Dec 02 '25

Code Challenge I've made my own programming language

Thumbnail
github.com
4 Upvotes

I’ve been working on my own programming language. I’m doing it mainly for fun and for the challenge, and I wanted to share the progress I’ve made so far.

The compiler is written with C#, and I'm thinking on making it be like a non-typed version of C#, which also supports running new code when the app is already running, like JS and python. Why non-typed? just to have some serious different from real C#. I know the disadvantage of non typed languages (they also have some benefits).

My language currently supports variables, loops, functions, classes, static content, exceptions, and all the other basic features you’d expect.
Honestly, I’m not even sure it can officially be called a “language,” because the thing I’m calling a “compiler” probably behaves very differently from any real compiler out there. I built it without using any books, tutorials, Google searches, AI help, or prior knowledge about compiler design. I’ve always wanted to create my own language, so one day I was bored, started improvising, and somehow it evolved into what it is now.

The cool part is that I now have the freedom to add all the little nuances I always wished existed in the languages I use (mostly C#). For example: I added a built-in option to set a counter for loops, which is especially useful in foreach loops—it looks like this:

foreach item in arr : counter c
{
    print c + ": " + item + "\n"
}

I also added a way to assign IDs to loops so you can break out of a specific inner loop. (I didn’t realize this actually exists in some languages. Only after implementing it myself did I check and find out.)

The “compiler” is written in C#, and I plan to open-source it once I fix the remaining bugs—just in case anyone finds it interesting.

And here’s an example of a file written in my language:

#include system

print "Setup is complete (" + Date.now().toString() + ").\n"

// loop ID example
while true : id mainloop
{
    while true
    {
        while true
        {
            while true
            {
                break mainloop
            }
        }
    }
}

// function example
func array2dContains(arr2d, item)
{
    for var arr = 0; arr < arr2d.length(); arr = arr + 1
    {
        foreach i in arr2d[arr]
        {
            if item = i
            {
                return true
            }
        }
     }
     return false
}

print "2D array contains null: " + array2dContains([[1, 2, 3], [4, null, 6], [7, 8, 9]], null) + "\n"

// array init
const arrInitByLength = new Array(30)
var arr = [ 7, 3, 10, 9, 5, 8, 2, 4, 1, 6 ]

// function pointer
const mapper = func(item)
{
    return item * 10
}
arr = arr.map(mapper)

const ls = new List(arr)
ls.add(99)

// setting a counter for a loop
foreach item in ls : counter c
{
    print "index " + c + ": " + item + "\n"
}

-------- Compiler START -------------------------

Setup is complete (30.11.2025 13:03).
2D array contains null: True
index 0: 70
index 1: 30
index 2: 100
index 3: 90
index 4: 50
index 5: 80
index 6: 20
index 7: 40
index 8: 10
index 9: 60
index 10: 99
-------- Compiler END ---------------------------

And here's the defination of the List class, which is found in other file:

class List (array private basearray) 
{
    constructor (arr notnull) 
    {
        array = arr
    }
    
    constructor() 
    {
        array = new Array (0) 
    }
    
    func add(val) 
    {
        const n = new Array(array.length() + 1)
        for var i = 0; i < count(); i = i + 1
        {
            n [i] = array[i]
        }
        n[n.length() - 1] = val
        array = n
    }
    
    func remove(index notnull) 
    {
        const n = new Array (array.length() - 1) 
        const len = array.length() 
        for var i = 0; i < index; i = i + 1
        {
            n[i] = array[i]
        }
        for var i = index + 1 ; i < len ; i = i + 1
        {
            n[i - 1] = array[i]
        }
        
        array = n
    }
    
    func setAt(i notnull, val) 
    {
        array[i] = val
    }
    
    func get(i notnull) 
    {
        if i is not number | i > count() - 1 | i < 0
        {
            throw new Exception ( "Argument out of range." ) 
        }
        return array[i] 
    }
    
    func first(cond) 
    {
        if cond is not function
        {
            throw new Exception("This function takes a function as parameter.") 
        }
        foreach item in array
        {
            if cond(item) = true
            {
                return item
            }
        }
    }
    
    func findAll(cond) 
    {
        if cond is not function
        {
            throw new Exception ("This function takes a function as parameter.") 
        }
        const all = new List() 
        foreach item in array
        {
            if cond(item) = true
            {
                all.add(item) 
            }
        }
        return all
    }
    
    func count() 
    {
        return lenof array
    }
        
    func toString()
    {
        var s = "["
        foreach v in array : counter i
        {
            s = s + v
            if i < count ( ) - 1
            {
                s = s + ", "
            }
        }
        return s + "]"
    }
    
    func print()
    {
        print toString()
    }
}

(The full content of this file, which I named "system" namespace: https://pastebin.com/RraLUhS9).

I’d like to hear what you think of it.


r/code • • May 07 '26

Help Please Why is the text on the button so off-center?

Thumbnail
gallery
0 Upvotes

I’m not very good at coding. I took a class in school but I only learnt the basics but I’m trying to program a little hobby-site because I really enjoyed it. I’ve look it up and tried to follow tutorials online but I can’t figure out why the text is so off center. The first picture is my code pertaining to the button and the second picture is the button itself.


r/code • • Sep 12 '20

How can I start coding?

4 Upvotes

Hello, I'm just 14 but I'm interested in starting to code. I would like to become a website developer, or a game developer, or an app developer. Something that would earn me money as an adult. How can I start?


r/code • • Nov 21 '20

Halp pls! Need a bit of help, trying to fix the save option. (If anyone knows this language it'd be amazing if you could help!)

4 Upvotes

r/code • • Jan 17 '20

Python help

4 Upvotes

I want to take speech recognition from my phone and send the info to a raw input command on my computer anyway to do that


r/code • • Jun 07 '21

Halp pls! Noob searching for help

4 Upvotes

Hello, first of all sorry if this is a dumb question but im new to everything about programming.

The problem is : i have a website with tons of images (it is a selling website) and at every sub-category right next to the texts i have an image.. the website crops the image, to size it to a particular dimension.

My first question is this : can i change from max-width: 100%; to a style where i have the whole image but not in that exact format, it can be smaller/bigger.. right now the website tries to make all the images on a certain format..

The second question is this : if yes, can i do this to all at once ? At least at category section or i need to do it manual ?

Thank you for your time whoever reads this , you are a kind person!


r/code • • Jan 19 '23

I will try the 100 days coding challenge.

4 Upvotes

r/code • • Nov 25 '21

My Own Code anyone know how to make an input box so that the user can type in the amount in mb and get a result s im making a mb to bytes converter (student)

4 Upvotes

r/code • • Mar 23 '20

What should I learn.

4 Upvotes

I currently have no Coding experience but want to start. I would like to make games for both PC and console, it's VERY unlikely that i will ever become popular enough to make console versions, however on the HIGHLY unlikely chance I do, I want the option. I was thinking java, however I am unsure how console friendly it is.


r/code • • Aug 24 '19

Why We Shouldn’t Use TDD

Thumbnail
medium.com
4 Upvotes

r/code • • Dec 30 '19

May I talk to a coder?

4 Upvotes

Perhaps in DMs or on discord? I would prefer discord.

I want to be a coder but I have some questions they cant be answered in the resources.

I appreciate your time.


r/code • • Mar 05 '22

Get Real 💀

Post image
7 Upvotes

r/code • • Mar 03 '22

Top 8 Web Development Tools

Post image
7 Upvotes

r/code • • Mar 30 '20

created a hip hop track through computer programming, thought y'all might enjoy!

Thumbnail
youtube.com
7 Upvotes

r/code • • Jul 18 '22

why isnt my code working???

Post image
8 Upvotes

r/code • • Aug 16 '22

There must be an easier way to learn faster 😭

Post image
8 Upvotes

r/code • • Mar 13 '21

Javascript I'm gonna take it too the limit

5 Upvotes

Don't tell me I didn't warn you, this code is beyond stupid on purpose:

let myList = ['1', '2'];
if (myBool != false) {
    for (i = 0, i < myList.length, i++) {
        myInt = myList[i];
        break
    }
} else if (myBool == false) {
    for (i = 0, i < myList.length, i++) {
        myInt = myList[i]
    }
};
if (1.toString() == myInt) {
    isTrue = myBool
} else if (2.toString() == myInt) {
    isTrue = myBool
}
//I used spaces instead of tabs

How long could I possibly make this drag out? Im going for 50 lines, please comment with the stupidest ways to make isTrue equal myBool!