TheSandwichCoder
TheSandwichCoder
  • 9
  • 38 225
Python Developer learns Rust (and remaking my chess engine)
Wait what... I dont actually hate rust?!? I guess I just clickbaited yall then...
The Chess Video will be coming soon! After probably another 2 months... maybe 3 months.
Wow I am getting lazy at writing descriptions... probably no one will read this anyway.
Githubs:
Space Invader (why?): github.com/TheSandwichCoder/Bevy-Space-Invaders
Ball Simulation: github.com/TheSandwichCoder/Bevy-Ball-Simulation
Rust Chess Engine: github.com/TheSandwichCoder/ChessEngine-Rust
Whhhhaaatt... you are still here? here have a dinosaur 🦕
Переглядів: 33 261

Відео

Making a Ray Tracer in Python #rtx #programming #gamedev
Переглядів 7333 місяці тому
I made a ray tracer(path tracer) from scratch in python. This video is much more laid back in terms of editing and animations than the other ones, so tell me if you like it more! although I forgot to mention it in the video, this would not be possible without: Ray Tracing in One Weekend raytracing.github.io/books/RayTracingInOneWeekend.html I also mentioned: Sebastian Lagues RTX : ua-cam.com/vi...
Making a Chess Bot from Scratch (part 1) #chess #chessbot
Переглядів 1 тис.5 місяців тому
In this video I made a chess bot from scratch in c (first c project). Im hoping to improve on it and hopefully make a follow-up video where it might beat me. If I'm not lazy, a link to the Github to play the chess bot will be in a comment below. DISCLAIMER: this is still a massive work in progress, so there are many bugs and crashes still Pls subscribe since this video and bot took like 4 month...
Making a Checkers Bot in 60 Seconds #pygame #gamedev #programming #shorts
Переглядів 1817 місяців тому
what I meant to say was that you can check the description for the game. Also I really did the bare minimum for this bot to play properly so if you're interested in a more detailed video on chess bot programming, come check on me in a month If you wanna beat the bot, you can download and try it here: github.com/TheSandwichCoder/CheckersBot Rules for my version of checkers: 1. All captures are f...
I made a Physics Simulator from scratch in Pygame #pygame #gamedev #physics
Переглядів 4968 місяців тому
In this video I made a physics simulator in pygame. I actually made this quite a long time ago but hey making a video takes time. I also made the Suika Game. Take note: the Suika game has a lot of bugs the main one being you just cant do anything. Im too lazy to fix it. also how many people would actually read this anyway right? If you are interested in playing with the physics simulation or Su...
Making a Game for Christmas in Pygame #pygame #programming #gamedev
Переглядів 39510 місяців тому
Merry Christmas! So I made a game for Christmas cus why not right. This was a really big challenge and I faced alot of bugs on the way, but I think it turned out well and was worth it in the end. Of course, I could not have done it without Perlin Noise code made by: Supreme Sector(1d terrain noise): Video: ua-cam.com/video/QHdU1XRB9uw/v-deo.html Github: github.com/Supreme-Sector/Python-Perlin-N...
I made a game for NNN in 7 days
Переглядів 13411 місяців тому
Hey so I made a game for No Nut November in 7...8 days well you will know when you get to that part. Its a shame that I lost the first half of the recording but I think the video still turned out find right? This is the first full actual video on my channel, so let me know whether you enjoy it. I got the .exe file working, so download it and try to run it. I promise you its not a virus... I thi...

КОМЕНТАРІ

  • @scoutchorton
    @scoutchorton 6 годин тому

    Rust has such a steep learning curve, but once you stop boxing with the compiler and borrow checker and end up dancing with it, it's such a wonderful experience. Once I got to that point (like 1 month of playing after a 5 month hiatus) I was the most productive I've ever been with code

  • @juupaju889
    @juupaju889 13 годин тому

    gooning to this :)

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

    please make more videos! you're amazing

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

    Hey dude, awesome video!! I'm your thousandth subscriber, very well deserved. Please keep going 💪🏼

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

    Ah okay, so you are only just starting to learn how to program. That makes more sense. I would suggest you start with C and avoid all of the pitfalls of C++ or Rust. If you use Windows, then I'd suggest LCC-Win64 which provides an IDE and compiler and its compiler has extensions for operator and function overloading. That addition alone makes it worth the effort to use as a compiler even on Linux, because it runs perfectly with WINE. The easiest way to remember lifetimes with C is malloc() before you need it and only free() it when you're done with it. A simple way to handle that is if you are in a new scope and know you'll need something, go ahead and write two lines and insert new code between them: obj = malloc( ... ); free( obj ); and fill in the ... when you get to it.

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

    Bro your video editing is peak. 100/100. Claiming my OG ticket rn rn

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

    Nice video. Now redo it in haskell.

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

    10:08, I have my questions with this problem, this can be avoided by doing direct indexing, something like my_vector[I].collides(my_vector[j]), but I don't really know if this is the most optimal thing to do, this is how I always do it

  • @AbelShields
    @AbelShields 4 дні тому

    10:17 nooo, please dont copy everything to avoid the borrow checker 😭 you want itertools `.combinations()` or `.tuple_combinations()`

  • @penzyth-j8w
    @penzyth-j8w 4 дні тому

    been watching a lot of your videos and this is all really nice content! hope you enjoy the exposure from the rust video and can't wait to see what's next

  • @emeraldmonarch3592
    @emeraldmonarch3592 4 дні тому

    I really recommend Lobster, it's a language that is statically typed, can compile and link with C++ and looks like python/C#

  • @TheRealMangoDev
    @TheRealMangoDev 4 дні тому

    subbed! good vid. Also ye i subbed gefore 1k :)

  • @lennuard_6998
    @lennuard_6998 4 дні тому

    rust snytax looks awful to me

  • @Fasyle
    @Fasyle 4 дні тому

    Nice stuff! Glad to see your subs 10xed at the time of this comment

  • @SameForYouWasTaken
    @SameForYouWasTaken 4 дні тому

    quick, become friends with me before you become famous so I could brag to everyone else in the comments

  • @n3ttx580
    @n3ttx580 4 дні тому

    It was all fun and games until 6:34 bro what the actual fook. You SHOULD rely on GH Issues/Discussions and official documentation, and NOT on hallucinating autocorrect.. ChatGPT programmers smh. Funny video, but jesus please stop being bs programmers

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

    I just got a new follower, please keep making new videos

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

    OMG yes zaddy, I woukdl love to see you work on this project and tickle my ferret

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

    Getting pipebombed by bad ChatGPT rust code is I think the main thing slowing me down. Only when writing new code and forcing ChatGPT to comply can I get something useable. Remaking my main game in rust, 6k lines deep and I’m loving it now that I have a strong handle on rust concepts

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

    6:14 it's compiling the engine too so it takes so long, after first compile it should just compile what you change.

  • @Lil_Paper_towel
    @Lil_Paper_towel 7 днів тому

    I just did this like 2 months ago like the exact same transition

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

    !!!

  • @MT-cf2ms
    @MT-cf2ms 8 днів тому

    3:06 in python you can also use f strings instead of concatenation, so in this case it would have been f"the first part of the text {var1} the other part of the text" just like rust, and yes the f before the brackets is needed

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

    0:32 bro update your pc

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

    Difference between String and &str(string slice) is its lifetime, effectively '&' in rust denotes we r using reference of the var, so in case of &str its lifetime depends upon original scope i.e. passing and returning gets difficult and sometimes not possible to use. There are further complications like not being able to use it later and so on as it is just reference to a string. Meanwhile 'String' type is a heap allocated variable that can be understood as normal working variable you would expect off of vars like int and so on. It is closer to String type from C++, also heap allocated memory need not be deallocated manually as it uses RAII. This is what i understand as a beginner, there definitely are some mistake but it is what i have understood

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

    Shit python is better. This takes forever to do anything😂

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

    Just a point, the fact that its now a struct type and not a class, in the end (even though C++ is touted to be more OOP hence the keyword class) they're literally the same kind of data structure, it doesn't really make a difference. Btw, no one using OOP languages is actually doing proper OOP arch, the concept of taking "real world concepts" and distilling them into a collection of classes is not what OOP is.

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

    I was going to make fun of you for using python, then I saw you using Windows, so i'd rather make fun of you for that instead.

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 11 днів тому

    15:24 I'm surprised you didn't learn all of these concepts (except maybe memory safety but even that you learn by segfaults) when you went from Python to C++.

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

      well, my way was: js + ts -> c++ (for really short period of time) -> rust i think the reason for this is mixed, it could be that c++ has very poor documentation? or its not really user friendly? c++ learning resources are not well structured? (see rust book, rust by example, rustlings, rust playground)

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

    Stop using ChatGPT king

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

    YEAH BUDDY LESS FOOKIN GOOO, I made as well engine on Rust, it was much easier for me than on C++ since I'm bad

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

    The thumbnail says you hate rust as much as I hate wayland.

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

    note to self: raytracing in python is slow (that's crazy)

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

    mutaball

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

    This video is SO well made it’s actually crazy. It’s great that it blew up, because it deserves it

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

    You put so much work into this video. 😭🙏 This guy deserves more subs.

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

    I was reading the comments when I read about your sub count, and checked it. I was sure you would at least have 120k subs

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

    10:18… is that O(n^2)? lmao. Can you make a grid where you check each square and see if balls collide that way? Splitting it up will I think make it O(nlogn) until you check for collisions at the edge of the grid, still better than checking every ball n times where n is the number of balls.

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

    sorry to take you away from 666 subs

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

    6:34 "ChatGPT gave me a lot of wrong information" you don't say 😄

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

    10:30 you couldve avoided copying by indexing rather than using iterators

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

    For me, the part I hate (and it's a deal breaker) from rust is only one mutable borrow at a time.

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

    A usize is an unsigned integer whose size is defined to be the minimum size needed to store the highest possible addressable memory location for your machine. The thing about Rust is that at first a lot of things seem cumbersome, but when you stop to seriously ponder the question "what's the alternative?" you quickly realize that Rust is the best by far in most, if not all, categories.

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

    I’d be interested to know why you put unreal engine as the most difficult engine on your graph? I guess your view is very programmer oriented as I think most people would associate unreal with being far more friendly than straight code like bevy or sfml.

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

    amazing now try zig :D

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

    Never intro again

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

    Perhaps you should read the manual instead of asking a chat bot.

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

    10:05 This is why I think it is better to learn C++ before Rust -> There is nothing inherently wrong about multiple mutable references, and your code would work just fine with them. Just use unsafe and assign mutable references anyway. So long as they don't alias (reference the same thing) it's perfectly fine in Rust. The reason they are avoided is for a couple of very rare edge cases. If you append to a vector, then the vector might move it's content elsewhere (to find somewhere with more room). If you set an enum, then the old value will be invalid. Both of these operations invalidate the old value, so this is the case where multiple mutable references can be unsafe. You could write to a region of memory that no longer exists. If you are not working with Enums or Vectors, then this problem is unlikely to occur. Your elements probably don't contain enums or vectors, so this problem can't happen. Rust is being over-protective. That said, you should be aware that the compiler can rewrite your code (to make it faster), so you should follow the borrow-checkers rules as much as possible, and ensure that mutable references do not alias.

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

      "Just use unsafe and assign mutable references anyway" 🤣

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

      jokes aside, you should think 10 times before using unsafe in Rust, its not C and not C++ where unsafe is everywhere and where you don't care that much about memory safety as we care in Rust

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

      you better take a look at @HumanityAsCode comment

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

      or comment by @seanp5524

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

      @@xshady2967 Being aware of when you can use unsafe is a good skill to have. Cloning the entire vector is a very bad idea- it involves a whole new heap allocation plus copying all the content. The only reason to use Rust over a garbage collected language is for performance. Safety matters to an extent, but if the end result is slower than a garbage collected language, you might as well use the garbage collected language and avoid the headache of the borrow checker. If you can stick to safe and still be reasonably efficient, then it's worthwhile doing so. I just don't see a good way to do that here. Maybe I am inexperienced though.

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

    7:42 ECS is fast because you can split things up into smaller pieces. This allows you to only request the values you need for the operation that you are doing. Normally, if you were to put everything together (like a single massive enemy struct), this would work just fine put potentially you will have unnecessary values that don't get used often, filling your CPU cache, slowing it down. The key thing is that the CPU transfers in chunks (roughly 64 bytes at a time) and the time that it spends transferring values can be a significant bottleneck. So when you are working with large amounts of entities (like 1000+) you need to separate out the entities into smaller pieces to speed up the transfer time. If you are rendering to the screen, for example, you only need sprites and positions, you don't need the whole entity to do that. With ECS, you can split up entities into smaller parts to do these kind of heavy throughput while still relating the parts (components) to each other. If you are making a physics engine, you can have the physics engine only fetch colliders, and ignore all the other stuff that the entities might have.

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

    Blud is a cheeseburger