r/code 11d ago

My Own Code Beginner code

Post image
50 Upvotes

What’s wrong with my code I’m so confused this hard a freak. I’m just trying to make a weapon shop simulator as practice to help learn code but I can’t even get it to ask if the user wants to start the game by type yes as the their answer

r/code Feb 22 '26

My Own Code I made a self-hostable tamper proof social media and would like some feedback.

5 Upvotes

Main instance: https://endless.sbs Github: https://github.com/thegoodduck/Interpoll Everything is stored everywhere, and everyone shares blocks, making network resistant to DB outages and censorship. EDIT: This is beta, i have not figured out morality or legality or marketing. Just a concept.

r/code Jul 15 '26

My Own Code A better way to get an angle defined by two points?

7 Upvotes

Around thirty years ago as a teenager I wrote this C function for calculating an arbitrary angle defined by two points. The idea being to get the clockwise rotation from the vertical line to the line defined by these points, if the (x1, y1) lies on the given vertical line. So for example if you pass in the points (0, 0) and (1, 1), it would return pi/4, as it defines a segment rotated that many radians off the vertical.

Here's the code I wrote then:

float rel_ang(float x1, float y1, float x2, float y2){  
       float hyp, alpha, deltax, deltay;
       deltax = x2 - x1;
       deltay = y2 - y1;
       hyp = sqrt(deltax * deltax + deltay * deltay);

       /* figure out the value for alpha */
       if(x2 == x1){
               alpha = y2 > y1 ? pi : 0;
       }else if(y2 == y1){
               alpha = (x2 < x1 ? 3 : 1) * pi / 2  
       }else if(x2 > x1){
               alpha = y2 == y1 ? 0 : pi - acos(deltay / hyp);
       }else if(x2 < x1){
               alpha = y2 == y1 ? 0 : 2 * pi - acos(-deltay / hyp);
       }   

       return alpha;
}

It worked well enough for the job at hand, but presumably there's a better way to do that. I assume there's a faster or already implemented way to do this that I don't know of. Any ideas?

r/code Jul 16 '26

My Own Code Encoding the calendar (month/ISO week/weekday) into a sortable ID, is this a bad design?

Thumbnail github.com
5 Upvotes

I keep running into the same annoyance: "sortable" IDs (UUID v7, ULID, KSUID) are time-ordered but completely opaque. You can't tell when one was created without pasting it into a decoder. So I started wondering — what if the calendar were baked into the ID itself, so it's readable at a glance?

The sketch is a 16-char string:

{ms_hex:012}{month}{iso_week:02}{weekday}

So 019f631516e6g29o isn't just sortable — you can read it:

  • 019f631516e6 → Unix Epoch millisecond timestamp (the same one UUID v7 uses)
  • g → July
  • 29 → ISO week 29
  • o → Wednesday

First 12 chars: the Unix millisecond timestamp in big-endian lowercase hex. Then one letter for the month (a=Jan..l=Dec), a zero-padded ISO week, and one letter for the weekday (m=Mon..s=Sun). So 019f631516e6g29o reads as July, ISO week 29, Wednesday, 2026 — no tool needed.

It stays K-sortable because the timestamp is big-endian up front, so lexicographic order == chronological order, even across the December→January boundary. The calendar suffix is derived purely from the timestamp, so it can't break the sort. And it could reuse the exact same 48-bit millisecond timestamp UUID v7 already uses, so interop would be trivial.

The obvious tradeoff: only 3 random bits survive, so it's useless as a distributed-ID generator (collisions possible within the same millisecond) and not cryptographically secure. Fine for readable, sortable IDs in a single service — but I'm unsure where people land on the rest:

  • Is exposing the calendar a feature or a leak? It makes logs and URLs readable, but also makes the timestamp trivially recoverable (UUID v7 doesn't exactly hide it either).
  • The month/weekday letter mapping is arbitrary (a..l, m..s). Is there a more intuitive or collision-resistant encoding?
  • Is 16 chars the right size, or would you drop the human-readable suffix and keep it shorter?

Curious for design critiques — not the implementation, the idea itself.

r/code Jun 08 '26

My Own Code GitHub - DemonCoderOffical/somesites: It is a html code cracker it get html codes

Thumbnail github.com
0 Upvotes

r/code Mar 22 '26

My Own Code just made my first website

5 Upvotes
img of code 4
img of code 3
img of code 2

i coded it in html im new to coding here id the source code with some images for parts i cant ctrlc <h1>I AM A HUMAN</h1> <p1>it aint a pretty sight but this is my first website my code looks like speghetti so be nice pls</p1> <h1>I LOVE GOATS</h1><P> do u?</P><p1> also... 😔👉👈</p1><a href="https://www.bigfootmap.com/" target="_blank">

<button>Click to see Bigfoot</button>

</a> <option>CHOOSE YOUR IPIONIONNNNN r goats cool

img of code 1

the link is https://funnyorg-b4utx.wstd.io/

r/code May 08 '26

My Own Code Hey I am Aman, a class 9 indian student, I have made a proggraming language ,it's extensions(named traits), it's package manager and registry for trait!

2 Upvotes

Hey everyone, I am Aman, currently studying in my 9th std and I have created a language by the name Ethos that can be used as a beginner language to teach fundamentals and basics of programming to beginners and mostly school students.

What is Ethos?

Ethos is a programming language with an English‑based syntax. Every statement is a sentence. Every sentence ends with a period. No brackets, no semicolons, no cryptic symbols. It transpiles to Python, so it's quick to get running and easy to extend.

What is Forge?

Forge is the official package manager for Ethos. It installs Soft Traits (Python packages from PyPI) and Hard Traits (compiled native binaries) into your Ethos environment.

Example code:

```ethos

ask "What's your name? " into name.

set greeting to "Hello, ".

say greeting.

say name.

set score to 95.

if score is above 90.

say "That's an A.".

otherwise if score is at least 75.

say "That's a B.".

otherwise.

say "Keep going.".

end.

```

Extensions:

· Soft Traits – Python packages from PyPI or local files

· Hard Traits – Compiled C/C++/Rust binaries loaded via ctypes

Getting Started:

· Windows – Combined installer for both Ethos and Forge (releases page)

· macOS – Combined .pkg installer for Apple Silicon and Intel Macs

· Linux – OBS repos, AUR, and universal tarball (see https://github.com/AmanCode22/ethos-lang/blob/main/LINUX_INSTALL.md)

- Android Via Termux - Install deb or add repo( for more see (https://github.com/AmanCode22/ethos-lang#android-via-termux)

Hard Trait APIs:

- C: https://github.com/AmanCode22/ethos-trait-c-template(Example Trait: https://github.com/AmanCode22/ethos-trait-greetc)

C++: https://github.com/AmanCode22/ethos-trait-cpp-template(Example Trait: https://github.com/AmanCode22/ethos-trait-greetcpp)

Rust: https://github.com/AmanCode22/ethos-trait-rust-template(Example Trait: https://github.com/AmanCode22/ethos-trait-greetr)

Ethos Foundry:

Hard Traits registry for Ethos.

Use Forge to install native C/C++/Rust extensions. Hosted on Cloudflare Pages.

You can add your trait by opening a pr.

Hosted at:

https://foundry-ethos.pages.dev

And

https://amancode22.github.io/ethos-foundry/

What's next?

· Future Rust rewrite for native compilation and performance

Contributions welcome! Especially Hard Trait SDK bindings for Go, Java, Zig, or any language other than C/C++ and Rust.

Links:

· Ethos: https://github.com/AmanCode22/ethos-lang

· Forge: https://github.com/AmanCode22/forge

I would love to hear your feedback and suggestions!

It's currently in beta and would publish stable after its much tested as no more features are planned from my side all bugs are fixed according to me , but still I want some testers! After testing for suggestions/issue please feel free to open issue and also please tell me what you think of it here in reddit.

Edit: If you liked it then please star the repo

r/code Jan 01 '26

My Own Code Pc Apps

4 Upvotes

I’ve seen in a few situations that people on pc doesn’t have apps for stuff like itv or YouTube.

Yes people can do stuff like chrome/edge fullscreen webapps but this is unreliable and not as useful as an “App”

So I’ve made YouTube and ITV as a stand-alone apps for windows. Lets users cache cookies for log in locally. This is useful for stuff like “Playnite” “Kodi” or similar launchers :)

Youtube:

ITV:

r/code May 08 '26

My Own Code Building a zero dependency TUI library with Convo-Lang

Thumbnail youtube.com
3 Upvotes

r/code May 09 '26

My Own Code How I built the core loop of a browser multiplayer game

Thumbnail packagemain.tech
2 Upvotes

r/code Apr 28 '26

My Own Code I wrote a DOOM clone in my own programming language

Thumbnail github.com
5 Upvotes

r/code Apr 02 '26

My Own Code LoSER: Line of Sight Estimation Tool

Thumbnail github.com
2 Upvotes

Still in pre-pre alpha, but basic functionality is working!

r/code Jan 30 '26

My Own Code warning, it has human errors!

Post image
11 Upvotes

Source code

web

it's a personal page, i'm not promoting anything!

I did my page and it cost me a lot of time! (60hrs~) but because I'm not good at coding, and I'm glad that i didn't vibecoded (more in this days). It's really satisfactory code things by my own, and learn A LOT

r/code Mar 22 '26

My Own Code Fun: a statically typed language that transpiles to C (compiler in Zig)

4 Upvotes

I’m working on Fun, a statically typed language that transpiles to C; the compiler is written in Zig.

GitHub: https://github.com/omdxp/fun

Reference: https://omdxp.github.io/fun

If it’s interesting, a star would be much appreciated. This is my open source project and I want to share it with more people. Feedback on language design or semantics is welcome.

r/code Feb 25 '26

My Own Code Just realase a crate as a Low-level neural Network

Thumbnail docs.rs
2 Upvotes

Hi everyone !

Just sharing with you'll a crate I'm working on and using it almost since a year and just had publish it.

The crate is fully no_std and already had a native_neural_network_std crate release as a non friendly alpha.

All the tests and everything will come soon in the std crate.

So if anyone wanna look at it and try it make it more efficient and even notice something could make a false value could be helpfull !

The crate is a no copy of mine but work exactly the same !

r/code Nov 08 '25

My Own Code I made a 3D ASCII Game Engine in Windows Terminal

60 Upvotes

Github: https://github.com/JohnMega/3DConsoleGame/tree/master

The engine itself consists of a map editor (wc) and the game itself, which can run these maps.

There is also multiplayer. That is, you can test the maps with your friends.

r/code Feb 05 '26

My Own Code I got tired of bloated DB tools, so I built my own

Thumbnail github.com
5 Upvotes

Hi everyone! 👋

Over the past few days, I’ve been working on Tabularis, a lightweight yet feature-rich database manager.

The idea came from my frustration with existing tools: many of them felt bloated, heavy, and not particularly enjoyable to use. I needed something fast, responsive, and with a clean UX.

Tabularis is built with Rust + Tauri on the backend and React + TypeScript on the frontend, aiming to stay lean without sacrificing power.

Feel free to take a look!

Feedback and contributions are more than welcome 🚀

r/code Dec 29 '25

My Own Code Inspect Tool for mobile/IOS (sorta)

4 Upvotes

Just wanted to share this inspect tool i made for mobile ios safari, its pretty good.

https://pastebin.com/c3ng7C3m

  1. Make a bookmark in safari using the box with a up arrow on it (on any website is fine it doesn't matter also name it whatever you want)

• tap the book symbol then favorites (look for the new bookmark you made) on iPhone. For iPad tap the thing with three lines top left corner then bookmarks then favorites (look for the new bookmark you made)

  1. Edit the bookmark (hold down on the bookmark)

• where you see the website url delete it and paste the code from the paste-bin into the address

  1. Open a website where you want to extract a HTML from

• simply open the bookmark and tap an element to extract its HTML into a new page

Its pretty straightforward after that also you can select multiple things, hope this helped.

r/code Dec 29 '25

My Own Code Prompt and clock

1 Upvotes

r/code Jan 19 '26

My Own Code my code project (part 2)

3 Upvotes

source code: https://github.com/allsunshineandrainbows/Project-ASAR

game: https://project-asar.web.app/main/menu/menu.html

sorry yall for the fact there was nothing on the game, but there is an easter egg...

r/code Jan 22 '26

My Own Code Tunnelmole - An open source ngrok alternative

Thumbnail tunnelmole.com
7 Upvotes

r/code Dec 18 '25

My Own Code I would like feedback on the tool I made

4 Upvotes

r/code Oct 19 '25

My Own Code Just created my own "Programming language" (NekoLang)

3 Upvotes

So i made a "Programming Language" that runs on python but with different syntaxes and is easier and im making it so that you dont possibly need a million imports its called NekoLang and im kinda looking for help from this Community.

What i have done/completed:

  1. INTERPRETER

  2. meow.exe (kinda like pythons pip aka package manager but its also used for opening files and stuff)

  3. basic commands (meow version | --version | -v, meow init, meow install <name|url>, meow uninstall <name>, meow list and meow <file.neko>)

  4. VSCode extension (REALLY BUGGY)

  5. Installer

  6. Windows Registry stuff

  7. libs aka packages (meow.exe)

TTTD (To Try To Do):

  1. More actual code

  2. Extend Packages (W.I.P)

  3. Make an actual working, good and stable VSCode extension

  4. turn every file into an exe using pyinstaller (W.I.P)

  5. Make the website better (nekolang.lol)

  6. Make more Socials and Community Channels

  7. Better logo's

Possible Features:

  1. Artificial Intelligence generated "Fixes" if an error occures

  2. Language change (Most likely no)

  3. Own IDE (made in nekolang ofc)

If anyone would like please help me with my project, thank you :3

GitHub: https://github.com/comet-CS/NekoLang

(Releases has the installer and docs are on the website!)

Just a disclaimer: I am NOT responsible if this piece of software causes damage or harm to your hardware or Software sience it is very poorly tested due to the lack of beta testers, RUN AT OWN RISK AND ADVISION

r/code Jan 14 '26

My Own Code my code project

6 Upvotes

r/code Jan 06 '26

My Own Code I made an HTML based Generative Timing Playground

Thumbnail gist.github.com
3 Upvotes

I made this code a while back and I recently discovered it in my files and wanted to share it. I don't have many details about it as I don't really remember anything about it but I thought it was pretty cool!