javidx9
javidx9
  • 161
  • 20 614 342
DIY Programming Language #2: Tokenising with Finite State Machine
In this video I use a Finite State Machine to parse complicated input into manageable tokens before feeding them to the Shunting Yard Algorithm I developed in part 1.
Source: github.com/OneLoneCoder/Javidx9/blob/master/SimplyCode/OneLoneCoder_DIYLanguage_Tokenizer.cpp
Patreon: www.patreon.com/javidx9
UA-cam: ua-cam.com/users/javidx9
ua-cam.com/users/javidx9extra
Discord: discord.gg/WhwHUMV
Twitter: javidx9
Twitch: www.twitch.tv/javidx9
GitHub: www.github.com/onelonecoder
Homepage: www.onelonecoder.com
Переглядів: 25 732

Відео

DIY Programming Language #1: The Shunting Yard Algorithm
Переглядів 42 тис.Місяць тому
In this video I demonstrate how the Shunting Yard Algorithm works, and produce a simple implementatin to solve basic mathematical expressions like a calculator would. Source: github.com/OneLoneCoder/Javidx9/blob/master/SimplyCode/OneLoneCoder_ShuntingYardAlgo.cpp Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: discord.gg/WhwHUMV Twitter: ...
Embedding Lua in C++ Part 3: Meh... Just use Sol...
Переглядів 26 тис.2 місяці тому
In this video, I show how to use the excelent Sol library/wrapper to integrate Lua in your C program. This is shown in direct contrast to how i did it in Part #1 which was bare bones, from scratch. Source: github.com/OneLoneCoder/Javidx9/blob/master/SimplyCode/OneLoneCoder_EmbeddingLua_Part3.cpp Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Disc...
Introducing 2D Geometry Library
Переглядів 49 тис.4 місяці тому
In this video, I introduce a One Lone Coder Community project called olcUTIL_Geometry2D. It's a new open source library that can perform many varied 2D primitive interactions. This video details how to use basic features of the library. Source: github.com/OneLoneCoder/olcUTIL_Geometry2D Live Demo: community.onelonecoder.com/members/javidx9/Geometry2DDemo1/ Patreon: www.patreon.com/javidx9 UA-ca...
Where Has Javidx9 Gone? (and more important things)
Переглядів 43 тис.10 місяців тому
olc::CodeJam 2023: itch.io/jam/olc-codejam-2023 Thanks to all the Discord Server members that post their progress, and help others with theirs. UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: discord.gg/WhwHUMV Patreon: www.patreon.com/javidx9 Twitter (or whatevs): javidx9 Twitch: www.twitch.tv/javidx9 GitHub: www.github.com/onelonecoder Homepage: www.onelone...
Coding Quickie: Handling Periodic Numbers with C++ Templates
Переглядів 40 тис.Рік тому
In this throw-together video I handle numbers that wrap, periodic numbers, using some C template trickery. It's not optimal. It's not clever. But it does server to illustrate how complex templates can make your program. Source: github.com/OneLoneCoder/Javidx9/blob/master/PixelGameEngine/SmallerProjects/OneLoneCoder_PGE_PeriodicNumbers.cpp Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/user...
Texture Sampling #2: Bilinear & Bicubic Samples
Переглядів 23 тис.Рік тому
Following on from Part 1, I look at two common sampling methods that aim to reduce artefacts, bilinear and bicubic point sampling. The former linearly interpolates between neighbouring pixels, and the latter uses even further pixels to bias cubic splines to give a smoother contour between pixels. Demo: community.onelonecoder.com/members/javidx9/TextureSampling/Part2/ Part 1: ua-cam.com/video/4s...
Texture Sampling #1: Points & Borders
Переглядів 33 тис.Рік тому
Texture Sampling is fundamental to all grahics these days, but I thought I'd have a bit of an exploration of what exactly goes on trying to emulate what we have come to expect of GPUs. In this video, I establish a little framework, and then create a texture sampling class to demonstrate various methods. Demo: community.onelonecoder.com/members/javidx9/TextureSampling/Part1/ Source: Released at ...
Serialising/Deserialising Structured Memory To Disk, AKA Savin' Stuff
Переглядів 83 тис.Рік тому
In this tedious and long video, I talk about an easy to use file format that's great for serilizing and deserializing data, i.e. Saving Things! Source: Coming Soon! Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: discord.gg/WhwHUMV Twitter: javidx9 Twitch: www.twitch.tv/javidx9 GitHub: www.github.com/onelonecoder Homepage: www...
olc::AllSorts - Text/Commands/Sounds/Jams
Переглядів 32 тис.Рік тому
A mixed bag video, showing off some cool new features of the olc::PixelGameEngine. A brief look at a new companion sound library olc::SoundWaveEngine, and a reminder that olc::CodeJam 2022 is almost upon us, register today! JAM: itch.io/jam/olc-codejam-2022 CODE: github.com/OneLoneCoder Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: disc...
Back To Basics! Fixed Point Numbers in C++
Переглядів 60 тис.Рік тому
In this video I look at a simple Fixed Point Number implementation in C . I use constexpr to let the IDE run the code without even compiling anything! The final result is a small template class that permits arbitrary precision fixed point calculations. Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: discord.gg/WhwHUMV Twitter: twitter.com...
Quirky Quad Trees Part 2: Dynamic Objects In Trees
Переглядів 41 тис.2 роки тому
In this follow on video, I modify our Static QuadTree to allow its contents to move dynamically, and build a simple game demonstrating large arenas, with many thousands of moving objects, updated, rendered and interacted with at high speed. Play In Browser: community.onelonecoder.com/members/javidx9/CreepyCrawleyCapture/ Source: Coming soon! Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/u...
Quirky Quad Trees Part1: Static Spatial Acceleration
Переглядів 68 тис.2 роки тому
In this video I look at how a simple quad tree can be used to partition space to make searching for objects within that space much much faster. Source: github.com/OneLoneCoder/Javidx9/blob/master/PixelGameEngine/SmallerProjects/OneLoneCoder_PGE_QuadTree1.cpp Patreon: www.patreon.com/javidx9 UA-cam: ua-cam.com/users/javidx9 ua-cam.com/users/javidx9extra Discord: discord.gg/WhwHUMV Twitter: twitt...
Dithering with Floyd-Steinberg in C++
Переглядів 55 тис.2 роки тому
Dithering with Floyd-Steinberg in C
Run-Time Error /RESET
Переглядів 27 тис.2 роки тому
Run-Time Error /RESET
olc::CodeJam2021 - Theme
Переглядів 23 тис.2 роки тому
olc::CodeJam2021 - Theme
olc::CodeJam2021 - Announcement
Переглядів 15 тис.2 роки тому
olc::CodeJam2021 - Announcement
How I Practice Programming: Five Dice
Переглядів 91 тис.3 роки тому
How I Practice Programming: Five Dice
IMPORTANT! CHANNEL UPDATE
Переглядів 53 тис.3 роки тому
IMPORTANT! CHANNEL UPDATE
olc::CodeZone - Mission Logs
Переглядів 21 тис.3 роки тому
olc::CodeZone - Mission Logs
Back To Basics: C++ Containers
Переглядів 178 тис.3 роки тому
Back To Basics: C Containers
Compiling PGE For Web Browsers!
Переглядів 43 тис.3 роки тому
Compiling PGE For Web Browsers!
Super Fast Ray Casting in Tiled Worlds using DDA
Переглядів 175 тис.3 роки тому
Super Fast Ray Casting in Tiled Worlds using DDA
Networking in C++ Part #4: MMO - Designing Passivity
Переглядів 71 тис.3 роки тому
Networking in C Part #4: MMO - Designing Passivity
Circle Vs Rectangle Collisions (and TransformedView PGEX)
Переглядів 46 тис.3 роки тому
Circle Vs Rectangle Collisions (and TransformedView PGEX)
Community Showcase 2020
Переглядів 29 тис.3 роки тому
Community Showcase 2020
Networking in C++ Part #3: MMO Client/Server Framework, Tweaks & Client Validation
Переглядів 61 тис.3 роки тому
Networking in C Part #3: MMO Client/Server Framework, Tweaks & Client Validation
Controlling Elegoo Robot Smart Car with ASIO and C++
Переглядів 39 тис.3 роки тому
Controlling Elegoo Robot Smart Car with ASIO and C
A Little Update Video
Переглядів 84 тис.3 роки тому
A Little Update Video
Networking in C++ Part #2: MMO Client/Server, ASIO, Sockets & Connections
Переглядів 120 тис.3 роки тому
Networking in C Part #2: MMO Client/Server, ASIO, Sockets & Connections

КОМЕНТАРІ

  • @DeepFriedOreoOffline
    @DeepFriedOreoOffline 23 години тому

    In an ecosystem where people generally hate object oriented programming because they've had bad experiences making structures before they know what they need, it's nice to see good videos explaining how to do it better!

  • @jacobsan
    @jacobsan День тому

    31:24 ffs

  • @ameerikbal8160
    @ameerikbal8160 День тому

    if i may ask why is the unit vector in x axis sinf(RA) and y axis cosf(RA) shoudn't it be opposite of what it is.

    • @javidx9
      @javidx9 День тому

      As long as you're consistent it doesn't really matter

  • @defeatSpace
    @defeatSpace День тому

    Say a specific star is at 'sector (0,0); offset (0,0)', how does the program determine that star is still the same star at eg. 'sector (7,11); offset (X,Y)' when drawing the game? I don't understand how it maintains accuracy when calculating the seed from the sum of sectors and offset. How isn't _that_ star from the first question a totally different star when calculating the seed at a totally different sector and totally different offset? Dying to understand. Does it have something to do with limiting the significant figures to 0xFFFF, or something else pertaining to bitwise, or something in the rendering part after 'if (star.starExists)', or a combination of all of that? Goodness me! Thank you 😆

  • @arazseyfinezhad5444
    @arazseyfinezhad5444 2 дні тому

    I don't understand at all you went over everything so quickly not only I understood nothing program is also broken. The view transformation does the Y rotation (yaw) but when I try to move the camera the Object itself moves along the X, Y, Z axis not along cameras X, Y, Z axis. now I'm stuck at this part of the code for a week unable to proceed any solution I try does not work. I wish you did not go over everything so quickly in the episode. (Edit: I SOLVED IT! Apparently when i defined my Y axis inverted so the last row of look at matrix should have been [T.A, -T.B, T.C] and definitely not [-T.A, -T.B, -T.C]

  • @brotherx6205
    @brotherx6205 3 дні тому

    for anyone using c++11, when adding the w field to the vec3d struct, you may have to also add a default and custom constructor so that the vector methods don't throw an error when returning an aggregate initializer for the struct

  • @mook575
    @mook575 5 днів тому

    I understand every single thing that you discuss in your compiler videos, but I know that I would never be able to implement said things on my own. And I’d feel like a total fraud if I tried copying your code just to end up putting it on my resume. This is my dilemma as a programmer. I love your videos. Any tips for this issue?

    • @javidx9
      @javidx9 5 днів тому

      Firstly, thanks and I appreciate the support! Secondly, people only learn anything through copying or being shown. Once the basics are there, your skills can develop on their own and that's where novel solutions and engineering stem from. In my experience through the community around this channel, I've come to learn that many folk expect to be able to code like someone with 30 years practice in just 2 years. I don't know your experience level, but don't underestimate your abilities right now, the first step is to acknowledge the things you can't do, at least then you know what to work on.

    • @mook575
      @mook575 5 днів тому

      @@javidx9 thank you so much for your advice. I actually recently graduated with a bachelor’s degree in software engineering but I can’t escape this imposter syndrome. I still have yet to land my first professional programming job. Your advice gives me something to surely think about however. I feel like there’s tons of stuff I can’t do. But I guess it also helps to know the type of stuff that I actually want to do. You’re awesome man!

  • @serotonin69
    @serotonin69 5 днів тому

    wtf am i watching

  • @hodayfa000h
    @hodayfa000h 6 днів тому

    Why? I want WHY and HOW

    • @javidx9
      @javidx9 6 днів тому

      As I tell my 3 year old, I want doesn't always get.

    • @hodayfa000h
      @hodayfa000h 6 днів тому

      @@javidx9 fair enough, i can still replicate it... but i guess i have to just do it and understand it later?

    • @javidx9
      @javidx9 6 днів тому

      For this kind of topic, it really does help to treat the matrices as black boxes, especially if you've not done linear algebra yet. This way you can still develop something satisfying without bogging down in the detail. Hopefully once you make your model spin for yourself it may drive a further interest in practical applications of linear algebra, it's win win!

    • @hodayfa000h
      @hodayfa000h 6 днів тому

      @@javidx9 i actually already understand the linear algebra i learnt it today, i just need to repeat this myself, and thanks for your help this video is amazing!

  • @PinkeySuavo
    @PinkeySuavo 6 днів тому

    What is this library ure using? Some graphics library?

    • @javidx9
      @javidx9 6 днів тому

      It's a command prompt

    • @javidx9
      @javidx9 6 днів тому

      It's a command prompt

  • @grapesofmath1539
    @grapesofmath1539 6 днів тому

    Man, you gotta be young indeed (or in the opposite end of the age spectrum, in which case, respect) to not to know what midi is, ha ha. Banter aside, thank you very much for this, as someone who grew up with many older computer games playing midi (well, really even the NES and other such retro consoles used midi), it's interesting for me to finally look into what the code actually looks like. Ik ik, even games nowadays use midi format, only the quality of the instruments have changed. I'd imagine at least the code of midi nowadays compared to an NES game's midi timing would be different, in much the way versions of C++ are different (but somewhat compatible) from each other, is that correct or is that wrong? Anyways, I always love your videos, even though I barely ever dabble in programming (because I just can't wrap my head around it xP)

  • @everettc.veilleux6341
    @everettc.veilleux6341 8 днів тому

    Alas this code no longer works for visual studio 2019 or 2022 :/ I love the project and the explanations but with recent changes to the c++ language ...

    • @javidx9
      @javidx9 8 днів тому

      Sure it does, the language doesn't change, but it does use some features which needs c++17, and by default in both those Vs, it's 14.

    • @everettc.veilleux6341
      @everettc.veilleux6341 7 днів тому

      @@javidx9 I am using ISO C++17 Standard (/std:c++17) and the code will run (with warnings). What you see in the console window, however, is not anything like a cube. More like a drunk cursor in tryouts for "The Flash" movie...

  • @churchers
    @churchers 9 днів тому

    Are you planning to add line and character counters so that the error reporting can give the exact location of an error? seems like a very simple addition that provides a nice feature many compilers have.

  • @fabriciorby
    @fabriciorby 9 днів тому

    insane 💀

  • @neizih2809
    @neizih2809 9 днів тому

    I always thought I had to be genius enough to come up with this only using my head, now I realize I will never learn if I continue thinking like that. Thanks man

  • @rm_steele
    @rm_steele 9 днів тому

    love the statement at 55:12 thank you for saying it

  • @bernieperales9348
    @bernieperales9348 9 днів тому

    Hi i tried following everything you did and i cant even get the rotation right. Im trying to figurenout what im donng wrong watching this video over and over again lol

  • @OMNI_INFINITY
    @OMNI_INFINITY 9 днів тому

    *Thanks! "OPERAND" though.*

  • @CarlosBisponanet
    @CarlosBisponanet 10 днів тому

    You t-shirt is so cool! I want one! :)

  • @brotherx6205
    @brotherx6205 10 днів тому

    anyone using a linux system and the SDL engine, you are going to have to modify the GetColour method a bit. The CHAR_INFO he uses here is for Windows systems. To work around it, I just made the method return a struct that contains the two data types that are needed (short and wchar_t) and everything worked fine.

  • @jemko
    @jemko 11 днів тому

    I´ve tried this for so long but i keep running into an issue where my player collides with a rectangle for 1 frame and then falls through it like its not even there, im entirely lost on this

  • @Foxx_doctor
    @Foxx_doctor 11 днів тому

    I'm not quite sure where I messed this up, but i have a "String Subscript Out of Range" error when I go to run it. I stopped around 16:00.

    • @Foxx_doctor
      @Foxx_doctor 11 днів тому

      I fixed an issue, but I still have two warnings. I got it to work though.

  • @heltongomes526
    @heltongomes526 12 днів тому

    Incredible video. Please make more videos about this language, please!

  • @roamingcelt
    @roamingcelt 12 днів тому

    Thank you. You just gave me the idea of adding pixels to my custom vector class. (eg v+px or v+=px)

  • @KeithKazamaFlick
    @KeithKazamaFlick 13 днів тому

    my sensei

  • @Phosdoq
    @Phosdoq 13 днів тому

    the system pause comment ☠

  • @toughbama
    @toughbama 13 днів тому

    What about if the data you need is within a struct within the C++ file. How would you reverse the roles of grabbing info from your C++ file to the lua file instead of lua hosting the info. I have a struct called GameData in C++ and I want to just call like player.getCurHp to get the HP from the GameData struct.

  • @gtgunar
    @gtgunar 13 днів тому

    9:20 my hungarian ass was real confused for a second.

  • @itsjustboarsley
    @itsjustboarsley 13 днів тому

    Great work mate. If I had existed 10 years ago I would have had an easier time writing my compiler in college. I’m glad creators like yourself are out there.

  • @timog7358
    @timog7358 13 днів тому

    really great video

  • @jonathancrowder3424
    @jonathancrowder3424 14 днів тому

    Don't worry, short form or normal form yt will inevitably show your video multiple times to the same people for no good reason.

  • @trwwrt5687
    @trwwrt5687 14 днів тому

    How was first compiler compiled ?????

    • @javidx9
      @javidx9 14 днів тому

      By hand!

    • @trwwrt5687
      @trwwrt5687 13 днів тому

      @@javidx9 can you make video about it

  • @calculus7
    @calculus7 14 днів тому

    I know you’re a good person because you put opening and closing braces on their own lines.

    • @johnbryan1049
      @johnbryan1049 9 днів тому

      I think he’s a good person but I do hate this about his coding style

    • @maskettaman1488
      @maskettaman1488 9 днів тому

      @@johnbryan1049 Just take it as something else you can (and should) learn

    • @johnbryan1049
      @johnbryan1049 9 днів тому

      @@maskettaman1488 yeah I used to use that style. I switched one day like 15 years ago and didn’t look back. It was just easier to read for me.

  • @zlatkovidlanovic6454
    @zlatkovidlanovic6454 14 днів тому

    OK ..i agree your tokenizer work well and seems that produce rock solid array of tokens ..or at least array of UDT ...so next step will be parser i guess..it is kind of hard to follow allthis because i dont use C++ i find is hard ... can you btw explain how function with parms can be called multiple times in a recursive call i mean how to 2 or more recursive calls know which call is already executed ,,thanks

  • @matt-xq1xv
    @matt-xq1xv 14 днів тому

    You always upload exactly what I’m looking for at the perfect time!

  • @InfiniteCoder01
    @InfiniteCoder01 14 днів тому

    I would like to point out a few things I would do differently: 1) Instead of Finite State Machine you could've just have a lexer class with a nextToken method, which would peek a char and decide what to do, for each variant just call a blocking function that returns a token 2) Maybe this is to keep things simple in the first episodes, but error handling with exceptions... In a programming language you'd probably want to get all errors at once (multiple error reports). So I'd store them in a vector. Note: This may not be very applicable for lexer, but for parsers error recovery is a thing. 3) Indexing char iterator with zero. It's a valid approach, but if this iterator was a stream directly read from a file (or simpler - linked list or set iterator), this probably won't work. Not all iterators implement indexing 4) Considering #1 and #3, I'd not collect tokens into a vector, but rather parse them immediately. This gets rid of memory and performance overhead and to make parsers easily you'd normally only need one token lookahead (peek a token and maybe consume it) 5) Parenthesis - as well as checking after the loop, you really should check for the count to be positive in closing parenthesis, so combinations like ")123(" are not accepted. But I would probably do it in the parser 6) Parser (more related to previous episode). I'd make a recursive decent one, it's normally more applicable for programming languages Yeah, this sounds kinda harsh, but I don't want to hurt. Just pointing some stuff out :)

  • @edwinmartens7459
    @edwinmartens7459 14 днів тому

    I've made compilers using Flex and Bison, but this is very interesting. Learning the craft from scratch. If you ever write a book about (game)programming I'll definitely buy it It may be a nice idea to add some learning order in your video's

  • @rajatmond
    @rajatmond 14 днів тому

    I am really impressed with the teaching style and choice of difficult but important topics. Any chance you will try automatic differentiation (mainly applied in neural network training)? This is also kind of difficult but also interesting.

  • @kumarjitdas1999
    @kumarjitdas1999 14 днів тому

    BADMAS(বদমাশ) in Bangla(বাংলা) means RASCAL in English

  • @user-qb8ff3nz1o
    @user-qb8ff3nz1o 15 днів тому

    I was looking so long for this

  • @stevenray8737
    @stevenray8737 15 днів тому

    Just spent the day going over your tutorial, using C and SDL, and its brilliant. The projection part reminds me of the code I was writting for a Raycasting demo, a few years ago.

  • @AndreyEfimov
    @AndreyEfimov 15 днів тому

    Thanks for the video! It really motivates me to do my job =)

  • @silloo2072
    @silloo2072 15 днів тому

    Incredible next le lexer?

  • @captainufo4587
    @captainufo4587 15 днів тому

    Seems fitting to call the language OLC++; OLC# if one feels maverick.

  • @stuartgibson9755
    @stuartgibson9755 15 днів тому

    It's plus, MINUS, add, or SUBTRACT. Never heard of "TAKE". Yes I live in the UK. I'm English. I was born here.

    • @javidx9
      @javidx9 15 днів тому

      You have five apples. Can I take two?

    • @stuartgibson9755
      @stuartgibson9755 15 днів тому

      @@javidx9 Nope.😁

    • @nanoic2964
      @nanoic2964 5 днів тому

      @@stuartgibson9755 Two times two.

  • @PeteC62
    @PeteC62 15 днів тому

    Did I miss the bit where you explained why you use "digit" as a synonym for "character"?

    • @javidx9
      @javidx9 15 днів тому

      I did what?!! Oh nooooo!

  • @alexanderramirez158
    @alexanderramirez158 15 днів тому

    this made me realize how unclever, stupid, and genuinely worthless i am. ive never organically developed anything without several resources, websites, and other people's code. this is natural selection in action, i am not cut out for this world at all lol.

  • @dudu0502
    @dudu0502 15 днів тому

    太好了,这是我一直等待的教程。感谢

  • @j.r.8176
    @j.r.8176 16 днів тому

    your videos make me very happy

  • @yovalter
    @yovalter 16 днів тому

    Excellent video as always! Loving this series :) May I suggest you check out std::bitset for the look-up table?