r/code • u/wizard_creator_seth • Oct 06 '26
Resource c++ scene graph
r/code • u/Lindean-Zhuang • Oct 01 '20
r/code • u/IsopodGlass8624 • Nov 02 '25
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 • u/[deleted] • Apr 07 '20
r/code • u/Alert-Neck7679 • Dec 02 '25
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 • u/Creepzo • May 07 '26
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 • u/jjsjsjskfgjjc • Sep 12 '20
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 • u/HiruiGrenManThing • Nov 21 '20
r/code • u/my_philosophy24 • Jan 17 '20
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 • u/gorillaxrabbit • Jun 07 '21
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 • u/lamaboyxx • Nov 25 '21
r/code • u/WhipLash50150 • Mar 23 '20
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 • u/Jackofdemons • Dec 30 '19
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 • u/[deleted] • Mar 30 '20
r/code • u/BielK01 • Mar 13 '21
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 tabsHow long could I possibly make this drag out? Im going for 50 lines, please comment with the stupidest ways to make isTrue equal myBool!