Estimating Pi With Commodore 64 Logo (the language, not the chicken lips!)

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 210

  • @Groose1972
    @Groose1972 4 ปีที่แล้ว +15

    The reason you needed to use parenthesis () around SPLITSCREEN is because it has optional parameters. You can use SPLITSCREEN by itself to change it from FULLSCREEN to having a text screen at the bottom. To set the number of textlines, you use the parenthesis. Another example is PRINT. You can print one thing with PRINT "Hello or print multiples things with (PRINT "Hello "World)

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +3

      Aha, thank you!

    • @Groose1972
      @Groose1972 4 ปีที่แล้ว +6

      @@8_Bit You're welcome. The reason for the odd syntax is because LOGO is based off of LISP. In LISP the parenthesis are always required, but LOGO only needs them in cases like this.

  • @Godzilla_Jesus
    @Godzilla_Jesus 4 ปีที่แล้ว +39

    Who dislikes these videos? Just how jaded does a human have to be not to enjoy this relaxed and informative creator?
    Keep them coming :)

    • @G.B...
      @G.B... 4 ปีที่แล้ว +6

      When I see there is a video by the gesturing hand (aka Robin) I don't care what's the topic, I want to watch the video, and I always learn something new. But some people are weird enough to "dislike" no matter what. Go figure...

    • @The.Doctor.Venkman
      @The.Doctor.Venkman 4 ปีที่แล้ว +3

      They're probably some losers who know nothing about the history of these machines that Robin explains so brilliantly. Even the news feeds in the UK picked-up on him taking the code of old records on my google feed.

    • @redsmith9953
      @redsmith9953 4 ปีที่แล้ว +3

      LOGO programmers , probably ...

    • @RamLaska
      @RamLaska 4 ปีที่แล้ว +5

      @@redsmith9953 Or Apple ][ users ;)

    • @RamLaska
      @RamLaska 4 ปีที่แล้ว +2

      @@G.B...
      I love the gesturing hand. It seems to be Robin's trademark. I do wish he'd show his face a little more, but I think the gesturing hand works for him. Also, the soft-spoken Canadian accent.
      See also:
      www.harkavagrant.com/index.php?id=250
      img0.joyreactor.com/pics/post/funny-pictures-auto-comics-stereotype-366758.jpeg

  • @sypialnia_studio
    @sypialnia_studio 4 ปีที่แล้ว +24

    I love the way you explain things, you have a very good speed and intonation when speaking, which makes listening pleasant and not exhausting. Happy pi day!

    • @8BitNaptime
      @8BitNaptime 3 ปีที่แล้ว +2

      Oh yeah he's the Bob Ross of vintage computing.

  • @vaclavtrpisovsky
    @vaclavtrpisovsky 4 ปีที่แล้ว +36

    At first I thought you would use the badge with the Commodore logo as a circle template for the algorithm...

    • @El_Guapo74
      @El_Guapo74 4 ปีที่แล้ว +3

      I read video title that way too lol

    • @ThereIsOnly1ArcNinja
      @ThereIsOnly1ArcNinja 4 ปีที่แล้ว

      Yep, something like that. A >>you got to be kiddin'

    • @cheater00
      @cheater00 4 ปีที่แล้ว

      that's what i thought too! haha

    • @vapourmile
      @vapourmile 4 ปีที่แล้ว

      Yeah, that's why I'm watching. Disappointed.

    • @Sharklops
      @Sharklops 4 ปีที่แล้ว

      lol kind of like Matt Parker calculating Pi with pies

  • @staglomagnifico5711
    @staglomagnifico5711 4 ปีที่แล้ว +4

    Logo and its derivatives being translated into the user's native language is a great educational feature. It taught me that it's a horrible idea and should never be done!
    I like the idea of drawing a point by "going forward 0 units". Reminds me of an anecdote about someone explaining the Paradox of Heaps to a programmer. If you remove sand from a heap grain-by-grain, at which point does it stop being a considered a "heap" of sand? The programmer answered: if you remove every grain of sand, it's now a heap of size zero.

  • @chainq68k
    @chainq68k 4 ปีที่แล้ว +5

    I hated Logo when I was a kid, as I first learned BASIC, and made little, but functional, usable "real world" programs with it, then a bit later even started playing with Turbo Pascal on the early PC, writing small games and stuff, and then in school they forced me to waste time instead to "learn" programming with this "useless" language which had no real world use but education, plus most of our Logo stuff was written on paper, and we very rarely fired up a computer to even try it... Because "you must understand algorithms first!". How to make a class of kids hate programming for life. :) Of course, now it still sparks a bit of nostalgia. I might even try to get a copy of this Logo to play around on my C64.

    • @bobbobbity463
      @bobbobbity463 4 ปีที่แล้ว +1

      You can use Turbo Pascal on the C64 as well!

    • @chainq68k
      @chainq68k 4 ปีที่แล้ว

      @@bobbobbity463 Whatever was available as Turbo Pascal on the C64 I'm sure it wasn't Borland's Turbo Pascal. Also, I played around with several editions of "Turbo Pascal v1.2" available online, and all of them seems to be pretty much unusable and gives all sorts of weird error messages (like suddenly unable to save the edited file, etc). So yea. I'm going to pass on this one I guess.

  • @75slaine
    @75slaine 4 ปีที่แล้ว +1

    Nicely done Robin. Man Logo takes me back. The extent of our “computer lessons” in school in the mid 80’s was being allocated 15mins at an Atari on a trolley hooked up to a TV with Logo running. Totally unguided. Hated logo as a result of sheer boredom after drawing some basic geometric shapes and eventually constructing a a crude house of a triangle roof, square building, square windows, rectangular door etc. The method in your video was intriguing. A modern take would be calculating Pi with a RayTracing API on a GPU 🤔

  • @logiciananimal
    @logiciananimal 4 ปีที่แล้ว +8

    Logo is basically a dialect of LISP. Some interpreters, like LogoWriter from LCSI allow for proper whitespace for ease of reading.

    • @duuqnd
      @duuqnd 4 ปีที่แล้ว +2

      I wouldn't say it's a dialect of Lisp since it doesn't have homoiconicity, but it does borrow a few ideas from Lisp.

  • @SimonCoates
    @SimonCoates 4 ปีที่แล้ว +7

    Great stuff - this is exactly the sort of thing I used to do on my C64 in my teens 👍
    I'd say your result was pretty good and you didn't have to eat Humble Pi 😁

  • @RamLaska
    @RamLaska 4 ปีที่แล้ว +1

    FYI, I tried this in perl on my linux machine.
    After about 2 billion calculations, it got to 3.1415...
    Yep, four decimal places. After two billion iterations.
    I also tried an "ordered" method, where I cut the square into a 32768x32768 matrix.
    That actually did worse. ^_^
    P.S. I'd kill for Perl on the C64, or some subset of it. Basic line numbers (and other limitations) make me want to cry.

  • @stephanevermette145
    @stephanevermette145 4 ปีที่แล้ว +2

    I loved Transactor magazine! I used to buy it around 1983-84...

  • @mikegarland4500
    @mikegarland4500 ปีที่แล้ว

    I can't tell you how many times I ran a pi calculating program on my C64 and would leave it running for days.. The only one I can remember using was a Gregory-Leibniz formula I found in a book. (I had to look up the name of the series/formula.) It involved setting up just a simple FOR:NEXT series to add (and subtract) 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13... and so on. Mathematics and computers fascinated me. I had no idea why it worked.. it was just fun to do, to me anyway. According to google it takes about 500,000 iterations to start getting close.. but I had so much free time back then. 😀
    Thanks for covering such an interesting subject.

  • @JefesGarden
    @JefesGarden 4 ปีที่แล้ว +1

    I learned Logo in elementary school, and used it again in high school for computer and geometry classes. I can still hear the teacher yelling at me to "Stop abbreviating! We're not there yet!" But I forget the name of the golf game we used to play in between classes...along with 99% of the commands. Thanks for the trip(s) down memory lane! :)

    • @granitepenguin
      @granitepenguin 4 ปีที่แล้ว +3

      HAH! I had exactly this issue in my LOGO class in High school. I already knew it and was taking it only because it was a prereq to take the Pascal class the following year. Teacher took points off an early quiz for "draw a square" where I used a repeat statement instead of doing multiple FD 40 RT 90. I argued for about 20 minutes "Does it draw a square? Yes. Then what's the problem?" and finally got the points back with the understanding "Try to stick to stuff we've learned in class." :-)

    • @robsku1
      @robsku1 4 ปีที่แล้ว

      @@granitepenguin That pretty much sums up what's wrong with that method of teaching. I'm just glad I didn't have to subject my programming to teachings of school - it could've just managed to crush my interest. Nah, I doubt it; I would've learned at my own pace anyway.

  • @rossdtool
    @rossdtool 4 ปีที่แล้ว +5

    You made me remember about the time I tried to write a program in basic on my c64 as a 10 year old to print pi to thousands of digits. I didn't succeed.

    • @nat14159
      @nat14159 4 ปีที่แล้ว +2

      Don't feel bad. The Pi Calculator in the video only managed to correctly compute pi up to 391 decimal places. (392nd should be 4, not 3.)

    • @rossdtool
      @rossdtool 4 ปีที่แล้ว +1

      @@nat14159 amazing that you noticed that. Also, my dad's name is Tom and he was a mathematition, specialising in semi groups.

  • @kangarht
    @kangarht 4 ปีที่แล้ว

    I love the high level take on c64 programming, and the cool examples you find to show of whats possible. really flexible stuff.

  • @CycloneBob30
    @CycloneBob30 4 ปีที่แล้ว +2

    It's been so long since I did LOGO! Cool seeing it again. Thanks. I remember making a graphic/text-based adventure game using logo back 1985-6.

    • @olik136
      @olik136 4 ปีที่แล้ว +2

      LOGO is the only programming language I have ever used- we had it in school in the late 90s- early 00s.... sadly there wasn't much with computers going on at my school--- but there was a project week where we used LOGO to program "Fischer Technik" (don't know if that stuff is still a thing- it is basically Lego with electronics and an interface)

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      When I was playing early graphic/text adventures from the 1980s (Blade of Blackpool is one example) they would visibly draw each location procedurally from primitives, rather than just display a pre-rendered bitmap. I often wondered if they were using Logo to make those images! It was a neat way of compressing the graphics.

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      @Oli K: sounds like a predecessor to Lego Minestorms?

  • @ColinTimmins
    @ColinTimmins 4 ปีที่แล้ว +5

    This brought back memories... “Turtle Turtle!” 🐢

  • @G.B...
    @G.B... 4 ปีที่แล้ว +15

    Awesome, estimating π with Logo - and on C64.
    Normally, the Monte-Carlo method can find an accurate estimation (up to 7 decimal digits) in about 1000 iterations, but it heavily depends on the platform (precision of mathematical operations in real numbers, and random number generator used). In any case, increasing the number of iterations too much won't help - it only causes an "oscillation" of the estimation around the exact value (similar to what you are experiencing in the end of the video). Why the program is not able to stabilize in an estimation accurate to 7-decimals? My guess is we have to blame truncation errors first. I am not sure what's C64-Logo's precision in mathematical operations, but judging from the results I'd say it's probably less than "single precision". A poor random number generator could also contribute to the oscillation around the exact value, and it's easier to check; there are many random number generators, relatively easy to implement in any programming language, and it is worth trying to replace Logo's RND with such an "improved" generator.

    • @csbruce
      @csbruce 4 ปีที่แล้ว

      LOGO's RANDOM function appears to return only integers, which will limit its precision. However, the sampling space used here is 2001 * 2001 = 4,004,001 points, so the precision available here should be at least five digits.

    • @d2factotum
      @d2factotum 4 ปีที่แล้ว +1

      I wonder how many different random numbers the RNG in C64 Logo can generate? I mean, if it's only using a 16-bit integer seed (no idea if it does, just wondering) then that's only 65,536 possible different random values no matter how long you run the program.

    • @alienrenders
      @alienrenders 4 ปีที่แล้ว

      BASIC on the C64 could only generate 256 random numbers. Probably the same thing here. Normally, you use the SID chip to generate random numbers. For LOGO, I would generate two random numbers from 0 to 255. Then do (A*256 + B). Then MOD it with the range you want (+1). This should give much better results. It'll still be biased, but you're not doing encryption, so should be good.

    • @d2factotum
      @d2factotum 4 ปีที่แล้ว +1

      @@alienrenders That was only true if you used RND(0). If you used RND with any positive number then you got a much greater range of possible random numbers, although I don't know how much greater.

  • @christopherpow8053
    @christopherpow8053 4 ปีที่แล้ว

    Thanks for the trip down memory lane! I wrote many Logo programs in the 80s. It was so much fun!!

  • @wimwiddershins
    @wimwiddershins 4 ปีที่แล้ว +1

    Logo on C64 was a big chunk of our computing class back in 1987 when I was in high school. I think we even had a little robot that would plot the commands to paper.

    • @collectivesartori
      @collectivesartori 4 ปีที่แล้ว

      Wim Widdershins same here in Oz. It was the main language used to teach basic programming skills.

  • @rorykurek643
    @rorykurek643 4 ปีที่แล้ว +1

    Really fun idea! Never heard of Logo before.
    I would think that the RND procedure should use (SIZE * 2) rather than (SIZE * 2 + 1), as the width of the interval [-1000, 1000] is 2000, not 2001. Maybe that's why using a SIZE of 1000 ended up being more accurate than 100 (smaller relative error)? But then you're missing out on one edge of the square... Hmm...

  • @joebloggs3116
    @joebloggs3116 4 ปีที่แล้ว

    This is awesome man, nerding us out big time with that logo flashback.
    Thanks for all the great content.

  • @nneeerrrd
    @nneeerrrd 4 ปีที่แล้ว +3

    Further speed optimizations:
    Make precalculatrd global constants SIZE2, SIZE_SQUARED and so on to avoid unnecessary multiplications on each step.

    • @nneeerrrd
      @nneeerrrd 4 ปีที่แล้ว

      Also, make INV_SCALE = 1/SCALE, to avoid division and replace it with multiplication @ 20:30

    • @nneeerrrd
      @nneeerrrd 4 ปีที่แล้ว

      Well, and creating your own RND wouldn't harm either ;)

  • @roaddan01
    @roaddan01 4 ปีที่แล้ว +1

    As a proud French Canadian, I can tell you that it is effectively rare that a programming language instructions are translated in French. To my taste, it is not wanted and brings many incompatibilities and transportability issues. In Quebec, the only other instance of that phenomenon that I know of is the macro language in MS-Office. Funny thing is that the macros are in French but the VBA instructions are in English. Further more, the translation is done when one convert's a macro in VBA but not the other way around. P.S. Keep on the great work. ;o)

    • @8BitNaptime
      @8BitNaptime 3 ปีที่แล้ว

      10 IMPRIME "BONJOUR MONDE"
      20 VA A 10
      COURS

  • @The.Doctor.Venkman
    @The.Doctor.Venkman 4 ปีที่แล้ว +1

    This was brilliant, Robin! I never experienced LOGO as a language back in the day and this showed its potential. Would love to see how fast this was in writing some game-like programs as I also used 6502 assembly!

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +2

      I think the short answer is Logo is faster than BASIC but still much slower than assembly :) I might do a video showing some of the other features it has.

  • @Electronics-Rocks
    @Electronics-Rocks 2 ปีที่แล้ว

    I remember using the Forth language which had the same environment by creating functions which became commands. Also using logo at the same time on my C128 while in sixth form to help the other children with challenging education needs.

  • @JoostSmits
    @JoostSmits 4 ปีที่แล้ว +3

    Loved this. The title lead to believe you would use the Commodore logo to calculate pi, which is certainly feasible. Next year?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +1

      Googling for Commodore Logo or C64 Logo was not returning many results about the Logo programming language!

  • @UReasonIt
    @UReasonIt 4 ปีที่แล้ว

    Wow, the Transactor magazine brings back a lot of memories!

  • @roberttoews2775
    @roberttoews2775 4 ปีที่แล้ว

    I was a teen in the 80's. I had the C64 (used the most), Atari, RS Colour Computer, Timex Sinclair, TRS-80 II & II . . .
    Programmed in BASIC, C, machine code, etc . . . and never heard about LOGO until today!
    Always time to learn something new. :)

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +1

      It's funny how so many don't know about it, while for many others it was their first or second computer language (after BASIC). It was one of those things you either learned at school or you didn't, and there wasn't a lot of opportunities to hear about it outside of school.

  • @nohjrd
    @nohjrd 4 ปีที่แล้ว +1

    Brilliant video! You did an amazing job explaining everything an keeping it interesting and engaging.

  • @nghermit4922
    @nghermit4922 4 ปีที่แล้ว

    Wow Logo! I took an out of school class in the early 90’s and programmed a game in Logo, that takes me back! I think I was 10 or so.

  • @kissingfrogs
    @kissingfrogs 4 ปีที่แล้ว

    that was an awesome Pi experiment, I was so willing it to converge on Pi

  • @Kajico
    @Kajico 4 ปีที่แล้ว +1

    That ending song for some reason reminded me of Square One PBS show. It would definitely fit right in with that show

  • @buffalodebill1976
    @buffalodebill1976 3 ปีที่แล้ว

    A nice version, though I prefer the default look of the Atari turtle (it actually looks like a turtle and not just a triangle). Around '87 I wrote a mini-game utilizing all four turtles, two of them controlled by joysticks (two players), the other two having 'AI' derived from the the inputs of each of the joysticks. It wasn't really fun to play, but definitely a 'let's do it' kind of a programming experience, memories of which I cherish.
    Anyway, LOGO was a nice little language to play with in the 80's, but sadly, almost no-one around me used it, or even knew about it. Here instead (I mean former Czechoslovakia), the ultra-popular KAREL was used, for educational purposes (not a bad educational language either).
    BTW there was one thing, that I always found hilarious - the default _almighty_ (LOL) Atari BASIC was shipped in an 8kB cartridge (there's quite some history in regards to Atari BASIC - today it's entertainment gold), while the LCSI LOGO (Atari LOGO) one utilized a 16kB one 😀

  • @Sharklops
    @Sharklops 4 ปีที่แล้ว

    Wow I loved LOGO back in elementary school in the late 80s. For the longest time I misremembered and thought it was actually called TURTLE

  • @Johnny-es9xg
    @Johnny-es9xg 4 ปีที่แล้ว

    Here in South Africa we had a ripped off version developed by one of our universities and was used in schools. It was for PC's running DOS and the graphics was much better(monochrome though) , the turtle actually looked like one.We just drew pictures with it and didn't write any programs and even had a version that ran on Windows. C64 versions were not available since there weren't many of C64's around here , even in the 1980's, just boring old IBM PC's and their clones. Still had fun though and I was really good at it.

  • @ronpetrick
    @ronpetrick 4 ปีที่แล้ว +1

    Fun episode! I remember reading an article back in the day in Run Magazine (R. Holleran, "A High-Performance Turtle", Run Magazine, Issue 19, 1985) that introduced support for a set of turtle graphics commands in C64 Basic. It wasn't full Logo but the commands were (somewhat) useful and the program listing in the magazine was short. :) Great stuff!

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      Did you use that for the James Bond (View To A Kill?) demo?

    • @ronpetrick
      @ronpetrick 4 ปีที่แล้ว

      @@8_Bit Yes, that's what I used. I remember being amazed how they were able to add new Basic commands for these kinds of graphics. I know I still have the disk somewhere with the View To A Kill demo.

  • @console
    @console 4 ปีที่แล้ว +1

    I got taught Visual Basic in localized German in School back in 1990. Wasn't easy, because I was already familiar with the English version.

    • @silkwesir1444
      @silkwesir1444 4 ปีที่แล้ว

      never heard of such a version of Visual Basic, and I'm from Germany and have used several versions of it over the years

  • @GeoffSeeley
    @GeoffSeeley 4 ปีที่แล้ว +2

    @6:26 reminds me of when I had to maintain some source code to the NATAL language developed by Canada's National Research Council (NRC) and as such the code was bi-lingual and included French variable names, etc.

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +1

      I did some contract work with a Montreal-based videogame company and even though it was against the standards, I'd find bits of French in the comments and occasionally variable names too.

  • @CaptainDangeax
    @CaptainDangeax 4 ปีที่แล้ว

    Returning to school, I have stars to draw in logo and I didn't know where to start. But more important than that, the spigot pi will be very interresting for me to benchmark my various µP projects

  • @eekee6034
    @eekee6034 2 ปีที่แล้ว

    Every time I learn more about Logo, I like it a little more. I don't think it'll displace Forth for me right now though. :)

  • @johansteenkamp9214
    @johansteenkamp9214 2 ปีที่แล้ว

    Thanks for the great video. Really interesting. One thing I was thinking, the Random number generator will most probably come up with quite a few duplicate pixels, which will happen more often when the screen is filled halve with pixels, which will most probably skew the stats. I guess LOGO cannot tell if a particular pixel has already been drawn to and ignore that pixel for the stats.

  • @0fend0
    @0fend0 4 ปีที่แล้ว +2

    I spy an M83 fan! Great video as always!

  • @LMacNeill
    @LMacNeill 4 ปีที่แล้ว +3

    12:26 -- looks like something drawn by a Spirograph. Anyone remember that toy from the '70s and early '80s?

    • @judgegroovyman
      @judgegroovyman 4 ปีที่แล้ว +1

      LMacNeill I thought the same thing! Spirograph was awesome!

  • @AnnatarTheMaia
    @AnnatarTheMaia 4 ปีที่แล้ว

    We use Monte Carlo sampling method for calculating market risk for reports which must be submitted to financial oversight authorities. The sampling space is ten million samples and the initial model is constructed in the R programming language. Monte Carlo is a very important and common methodology in the financial industry. You might want to try the Kalman filter for computing Pi, too.
    Also I can see now why they say Logo resembles Lisp: it's almost a Lisp dialect.

  • @fabronfretwell3257
    @fabronfretwell3257 4 ปีที่แล้ว +2

    Happy PI day!

  • @madyogi6164
    @madyogi6164 4 ปีที่แล้ว

    Very educative and cool fun with toys from the attic.

  • @NeilRoy
    @NeilRoy 4 ปีที่แล้ว

    Great video. I remember some turtle graphics programs for the C64. I always loved that sort of thing.

  • @andlabs
    @andlabs 4 ปีที่แล้ว +1

    This "Monte Carlo method" is basically a form of Bayesian inference, so you are computing pi similarly to how your email client filters spam :) It will **eventually** produce the correct answer, but only after an extremely long time - and even then, just how accurate you'd be would be limited to how many points you can put in the square (basically how precise the "PX and "PY variables in your RND procedure are), and may be hampered by the specific implementation of real numbers used by Commodore Logo. ("omfgbunder2008" below in the comments asked whether making the circle bigger would help. I'm not an expert here, but my intuition tells me that it would, but only with the same precision of the points, and only if you run the program longer.)
    Also I did not know the SuperCPU could speed up the main 6502; I always assumed it was just a coprocessor o_O Now I have to learn more about this thing...

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +1

      Thanks for the info! And yeah, the SuperCPU actually takes over the system bus so the C64's 6510 is idle; the 65816 in the SCPU is running the show. It's a fun thing to play with.

  • @bwack
    @bwack 4 ปีที่แล้ว

    Thanks! Fun experiment on computing pi. Loving your videos!

  • @csbruce
    @csbruce 4 ปีที่แล้ว +1

    0:25 It's a horsie!
    1:50 As a nerdy teenager, I memorized the first 50 digits of pi. The displayed result passes the sniff test.
    3:22 Seems odd that Mathematics is considered an Arts Degree by some universities. Where I went, math is considered its own faculty and Computer Science to be a field of mathematics.
    6:18 That is a bit odd. Most programming languages use English keywords, as a reflection of the environment in which they were developed, like most musical terms are Italian or ballet terms, French.
    10:31 It seems a bit odd how they jam all of the statements together inside of a REPEAT structure that are normally put on separate lines. How do they know where one statement ends and the next begins? Is it based on recognizing keywords and procedure names? Do the root-level statements really need to be on separate lines?
    11:00 I guess the leading ":" character prevents variable names from being confused with keyword/procedure names.
    14:40 Does LOGO have string variables? I guess the apostrophe is still free if it does.
    15:20 Does LOGO use only integers or does it have floating point? Your scaling factor would make the results more accurate if everything's an integer, but should have no effect if everything's floating point.
    15:58 Does LOGO have the concept of functions (vs. procedures)? Would functions need to be enclosed in parentheses? Though, I don't know why SPLITSCREEN would be a function.
    16:24 If LOGO doesn't have functions, then values need to be passed between procedures using global variables, which gives LOGO scalability problems like BASIC has: th-cam.com/video/eabOVMxn8iw/w-d-xo.html .
    17:40 When I see things like this, it makes me wonder about off-by-one errors. RANDOM apparently gives a results of 0 … n-1. Are you modelling the pixels as little boxes or as a grid of points? I guess the latter, with the point axes labelled from -1000 to +1000, inclusive. So far, so good. I guess the RANDOM function returns only integer values, which creates your need for scaling the coordinates to get better precision.
    18:12 The RANDOM(SIZE*2+1 = 2001) will produce a result from 0 to 2000, not 1999.
    18:34 I take it they distinguish assignments from reading references to variables with the (") vs. the (:).
    18:40 If :PX were a 16-bit integer, then 1000*1000 would exceed its capacity.
    18:56 Shouldn't that be a '

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +2

      Yes, the pi symbol might look more like a horse than the animals I suggested!
      re: 50 digits of pi, that's funny that's the same number Darren chose when writing his song. After spending so long recording, playing on, and mixing that song, I think I might even be able to sing back all 50. And yes, those characters are from the VIC-20 font! My friend Sam wrote a routine to plot the ROM pixels out with giant characters. And then I tediously synced the number changes up to the song.
      That Wisconsin arts degree in Math seemed weird to me too. Although I just stayed here in Thunder Bay for Computer Science, my education was heavily influenced by the University of Waterloo in many ways, from both high school teachers and university profs who were alumni of Waterloo, to the UW math and computer science contests. And I've been meaning to ask if a lot of Waterloo professors would call parenthesis "brackets" - I think that's where I got the habit which American viewers in particular often correct me about.
      LOGO does have string variables though I don't fully understand them. There's a whole bunch of aspects of the language I'll have to study more if I'm to make another video about it. LOGO seems to just automatically decide if the variable is an int, float, string, or list. The RANDOM primitive appears to return INTs.
      re: SPLITSCREEN, another commenter said that the parentheses are needed because SPLITSCREEN has *optional* parameters, and the parser doesn't know how to interpret it without the help of the ().
      Logo doesn't seem to have a >= or

    • @csbruce
      @csbruce 4 ปีที่แล้ว

      @@8_Bit: Maybe it's just that 50 digits is feasible to memorize, while 100's a lot tougher.
      I never noticed anyone calling parentheses "brackets" when I was at UW, and I would have noticed that if they did. The other university I went to now has Computer Science as its own independent faculty.
      So LOGO does have 'float's. On second thought, that's obvious from the printout of its estimate for pi. Those values only seem to have six significant digits, suggesting that they use 32-bit floats, which is odd considering that 40-bit float routines are available in the BASIC ROM for free, and six digits would have been considered unsophisticated in the era of 8-digit calculators!
      Does LOGO have logical operators? You could use '< OR =' or 'NOT >'.

  • @kduhtdkzrt
    @kduhtdkzrt 4 ปีที่แล้ว

    I‘d absolutely love more videos on Logo.

  • @misterjib
    @misterjib 4 ปีที่แล้ว

    Oh wow, i remember using what must have been logo turtle on a bbc micro at middle school, 82 or 83.

  • @collectivesartori
    @collectivesartori 4 ปีที่แล้ว

    Logo! Wow. Blast from the past.

  • @gnustep
    @gnustep 4 ปีที่แล้ว

    It speeds up because the you're doing an approximation of pi by cutting a circle into smaller and smaller slices. As the slices get smaller, the calculation is faster.

  • @Xeotroid
    @Xeotroid 4 ปีที่แล้ว

    I wonder if that French LOGO translation is where Microsoft got inspired to use different names for Excel functions based on localisation which causes issues between versions with different languages.

  • @TheArcaneBrony
    @TheArcaneBrony 4 ปีที่แล้ว

    when i heard turtle the first thing i thought was minecraft (theres a mod "computercraft" that adds turtles that can interact with the ingame world using lua, many of the language commands are added in too)

  • @ThomCote88
    @ThomCote88 4 ปีที่แล้ว

    This is awesome, I'd love to see more Logo videos

  • @Synapsenplatzer
    @Synapsenplatzer 4 ปีที่แล้ว

    Excellent video! So entertaining to learn something new!

  • @RamLaska
    @RamLaska 4 ปีที่แล้ว +2

    Instead of picking 10000 random numbers, would it be faster and/or more accurate to just follow a square pattern (i.e., FORY=1TO100:FORX=1TO100:... [in basic terms])?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +2

      It should be more accurate to fill every co-ordinate like that, but it would also be slower. I'm using a 2001x2001 grid and choosing randomly from that, so that'd be just over 4 million locations. We could do every X locations (like in your BASIC example, FOR Y=1 TO 100 STEP 10) but that would reduce accuracy. The neat thing about the random/Monte Carlo method is how quickly it gets a rough estimate between 3 and 4 after even just 5 or 10 points, while doing the more brute force method doesn't give a useful answer until it's pretty much finished. Or maybe halfway through it would also be a good answer?

    • @RamLaska
      @RamLaska 4 ปีที่แล้ว +1

      @@8_Bit
      Ok, getting a decent immediate answer makes sense for the random method. I'm still wondering if doing a "raster-style" calculation with the same number of points (i.e., 100x100 grid, instead of a random sampling of 10,000 from a much larger grid) would yield a more accurate result. Or just a more stable one (not randomized) ;)
      What do you think?

    • @csbruce
      @csbruce 4 ปีที่แล้ว

      ​@@8_Bit: If you used a binary decomposition on an index into a space-filling curve, you could both quickly cover the breadth of the sample space and then slowly zoom in while maintaining a uniform coverage of the sample space - the best of both worlds. For example, the first sample of a quadtree-midpoint scheme with a range of 0 to 1 (for the upper-right quadrant of a circle) would be (0.5, 0.5) = inside → π=4, then (0.25, 0.25) = inside → π=4, (0.75, 0.25) = inside → π=4, (0.25, 0.75) =inside → π=4, (0.75, 0.75) = outside → π=3.2, (0.125, 0.125) = inside → π=3.333, … This scheme will converge to the real value from above, coming closest after every 2²ⁿ+1 tests.

  • @uzimonkey
    @uzimonkey 4 ปีที่แล้ว

    Speaking of LOGO, I had Delta Drawing when I was a kid. I never really got it when I was a kid, the manual just seemed confusing and I could already program in BASIC, why did I need this drawing program thing? I never even gave it a shot, but looking back it was pretty awesome.

  • @DanafoxyVixen
    @DanafoxyVixen 4 ปีที่แล้ว

    I loved Logo back in the day with apple II's at school... still got a boxed copy and all the manuals for my Atari 800XL, as well as PILOT which i think also used turtle graphics

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      I almost used Pilot for this episode, but then found out that the C64 version I have only allows signed 16-bit integer variables. No floats would have made calculating Pi a pain!

  • @MichaelDoornbos
    @MichaelDoornbos 3 ปีที่แล้ว

    Had to revisit this video today since it's Pi Day again ;-)

  • @mikekopack6441
    @mikekopack6441 4 ปีที่แล้ว +1

    Damn, now I really want a SuperCPU...

  • @bgelais
    @bgelais 4 ปีที่แล้ว

    I remember that good old time of LOGO.

  • @Lilithe
    @Lilithe 4 ปีที่แล้ว +2

    Have you done a video on the SuperCPI? That seems pretty neat. :D

    • @andlabs
      @andlabs 4 ปีที่แล้ว +1

      (Joking about the typo) Given just how many unique and obscure things they made I wouldn't be surprised if CMD made a "SuperCPI" that only sped up trig functions on a C64 =P

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +4

      I haven't done a video dedicated to the SuperCPU yet; I should!

  • @richardperritt
    @richardperritt 4 ปีที่แล้ว

    Ha. Manual is stamped "Chapleau Public Library". Boy that brings back memories of growing up in Northern Ontario and cottaging just down the road from Chapleau. **sigh** Simpler times.
    Hope that SuperCPU is a v2 😉.

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      Seems like I have a few items that came from Chapleau! Unfortunately, the SuperCPU is just a v1. Never did get a v2, but now I wish I had spent the $200 back then!

  • @TheLostSorcerer
    @TheLostSorcerer ปีที่แล้ว

    Does Logo support colours? A simple improvement of the visualisation would be to have points inside the circle be green, points outside the circle be red.

  • @AureliusR
    @AureliusR 2 ปีที่แล้ว

    Was really hoping you would do more with Logo -- have you done another video about it?

  • @landsgevaer
    @landsgevaer 4 ปีที่แล้ว +2

    This algorithm can be made more accurate by not dropping -say-10000 points in the 2by2 square randomly, but by dropping 1 point each in a grid of 100by100 smaller .02by.02 squares. The first method has an error of order O(1/sqrt(N)) and the second O(1/N) if I am not mistaken, so double the number of digits accuracy!

  • @AntonioBarba_TheKaneB
    @AntonioBarba_TheKaneB ปีที่แล้ว

    Microsoft Excel in Italian also has all the commands translated! That’s a freaking nightmare

  • @DaveEverett01
    @DaveEverett01 4 ปีที่แล้ว

    Another episode on Logo would be great. Does logo interface to the expansion port? It coud then be used to control a turtlebot

  • @weedmanwestvancouverbc9266
    @weedmanwestvancouverbc9266 4 ปีที่แล้ว

    Did you play around with some of the oddball stuff like the VIC 1520 plotter? Any tales related to Jim Butterfield?

  • @osgrov
    @osgrov 4 ปีที่แล้ว

    Hah! That's cool. I haven't seen Logo since the 80s, it was nice to get a flashback. :)
    One of my biggest regrets in computing by the way, is that I never bought a SuperCPU when they were still affordable. It's kinda surprising nobody has attempted a modern revamp of the idea. Or have they?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      The fairly recent Turbo Chameleon V2 cartridge has an accelerator in it which is 6502-based instead of 65816 like the SuperCPU. Both approaches have their advantages. Watch out though, the TC will not work with a C128 at all, and may even damage it!

    • @osgrov
      @osgrov 4 ปีที่แล้ว

      @@8_Bit oh, I didn't know that! Thanks, I'm gonna have to check that one out. :)

  • @StrapMerf
    @StrapMerf 4 ปีที่แล้ว

    An interesting though on the Pi calculation method.. wouldn't simply looping through and dropping a pin on each location available(or every 5th, 10th etc) produce a more accurate result once complete? shouldn't be too hard to code(or even modify your code)

  • @belstar1128
    @belstar1128 4 ปีที่แล้ว

    Cool make some more video's about logo i remember hearing about it but i never saw it being used

  • @orangetiki
    @orangetiki 4 หลายเดือนก่อน

    Could we get a video of logo os? It looks fascinating

  • @proxy1035
    @proxy1035 4 ปีที่แล้ว

    that Logo program is a bit confusing to look at because LOGO also exists as a PLC for modern industrial automation.
    and i worked with that.
    just google "LOGO Siemens" to see what i mean.

  • @jack002tuber
    @jack002tuber 4 ปีที่แล้ว +1

    Funny thing about irrational numbers, they are all an approximation. After a few 100 digits that should be good enough for anyone. The anal retentives all have to ask, but what is it exactly? Then people like Robin and me go: Hold my beer

  • @3DMegadoodoo
    @3DMegadoodoo 3 ปีที่แล้ว

    What the heck? My dad bought the Commodore Logo for 495 marks back in the day and it did come with both diskettes but the manual was maybe a fifth the thickness of those :(

  • @HuntersMoon78
    @HuntersMoon78 4 ปีที่แล้ว +1

    Wonder what speed the ZX Spectrum Next can calculate pi.

  • @keancv
    @keancv 4 ปีที่แล้ว

    interesting video, how dose the area of the square minus 22.5% compare to the total area of the circle? Pi could then be derived

  • @kissingfrogs
    @kissingfrogs 4 ปีที่แล้ว

    A polar bear. I never saw that before. Any time I see Pi I will now see a polar bear even if most Pi symbols do not look like them

  • @billyjoejimbob75
    @billyjoejimbob75 4 ปีที่แล้ว

    What? 9000 decimal places? Wish I could've had it on the VIC 20.

  • @bengineer8
    @bengineer8 4 ปีที่แล้ว

    Wrote a Basic program on my graphing calculator:
    :0
    :For(n,1,10000
    :Ans+(1≥rand²+rand²
    :End
    :4Ans/n
    Got 3.147685231 in 371 seconds, which kind of shows how slow this approximation method is.
    [Edit: used a = sign when typing this comment but, happily, not in the program. Error has been corrected.]

    • @bengineer8
      @bengineer8 4 ปีที่แล้ว

      You know what, inspired by your video, I am going to see about writing a java program to track accuracy vs number off attempts.

  • @00Skyfox
    @00Skyfox 4 ปีที่แล้ว

    The circle it drew is really circular. Does Logo compensate for the rectangular pixels on the C64, or did the video capture do that?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      Good eye! It scales everything on the y-axis by default, so while there's 320 true pixels across, there's about 260 "pixels" vertically. That scalar can be adjusted.

  • @Sharklops
    @Sharklops 4 ปีที่แล้ว

    Here are a couple of my favorite interesting ways to calculate Pi:
    Buffon's needles: th-cam.com/video/sJVivjuMfWA/w-d-xo.html\
    Elastic collisions: th-cam.com/video/abv4Fz7oNr0/w-d-xo.html

  • @paulstubbs7678
    @paulstubbs7678 4 ปีที่แล้ว

    Pi to 800 digits nice, now where do I get an 800 digit calculator from.....

  • @logicone5667
    @logicone5667 4 ปีที่แล้ว

    I literally thought you meant the chicken lips at first.. lol

  • @Uterr
    @Uterr 4 ปีที่แล้ว

    so what result will be, if you simply fill inside of circle not using monte carlo?

  • @TrollingAround
    @TrollingAround 4 ปีที่แล้ว

    Please set a global var that = Size * Size and test against that. Also, the most accurate answer will be by testing every co-ordinate within the square (random co-ordinates just make it more interesting to watch!).

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      Thanks, yes, I should have done that optimization of pre-calc'ing Size * Size. Definitely random co-ordinates are more interesting to watch than brute-forcing through every co-ordinate, but they have another advantage: they give a decent estimate much quicker than iterating through all the points.

  • @WarrenPostma
    @WarrenPostma 4 ปีที่แล้ว

    Happy Pi Day!!!!

  • @gwheeler1609
    @gwheeler1609 2 ปีที่แล้ว

    Pi is 3.14....not 14.3!!! Strange Americans 🤣
    Love the videos. Only comment for your stats

  • @stefanocrespi5424
    @stefanocrespi5424 4 ปีที่แล้ว

    Hey, those guys at python's made the same turtle graphics mode!

  • @dans.8198
    @dans.8198 4 ปีที่แล้ว

    Oh, you mean “Logo” the language. I thought you were using Commodore’s “C=“ company logo. I need another coffee ;-)

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว +2

      That's been a common comment this video! Originally the title was "Commodore Logo" but that would have been even more confusing. I guess I should add a "ya know, the language" to the title.

  • @Breakfast_of_Champions
    @Breakfast_of_Champions 4 ปีที่แล้ว

    8-bit magic!

  • @renx99
    @renx99 4 ปีที่แล้ว

    great video! i did notice bursts of static when you did cuts... was it just my computer?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      I didn't notice any static (audio I assume?) while editing but I definitely rushed the editing of this video to get it out on time, so it may have more glitches than normal. Normally I make 3 or 4 passes over a video, and I only did about 1.5 this time.

  • @radman999
    @radman999 4 ปีที่แล้ว

    Robin, is there anything you don't know about C64? Great work!

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      Thanks, I'd like to eventually learn everything - it's been 36 years so far and I still don't know it all! :) I do have to prep for most episodes to get it back in my mind, but it's fun.

  • @rich1051414
    @rich1051414 4 ปีที่แล้ว

    I wrote this many years ago:
    double pi = 0;
    double mod = 1;

    for(int i = 1; i < 60000000; i+=2){
    pi += mod / i;
    mod *= -1;
    }

    double pi2 = pi + (mod / 60000001);
    pi = (pi + pi2) * 2.0;

    System.out.println("Calculated: " + pi);
    System.out.println("Ground Truth: " + Math.PI);
    Can you figure out how this calculates pi so accurately? :)
    If you can't tell, this is doing psudeo-integration, the higher the number of steps, the precise pi is calculated, but the longer it takes. If i is limited to infinity in the loop, then the answer would be exactly pi, if solving it were possible that is.

  • @3dgraphicsgamedev245
    @3dgraphicsgamedev245 4 ปีที่แล้ว

    Will there be assembler lessons in the future on your channel?

    • @8_Bit
      @8_Bit  4 ปีที่แล้ว

      7 of my videos so far have been at least partly assembler lessons or tutorials, and I do plan on making more. Here's a playlist of the ones so far: th-cam.com/play/PLvW2ZMbxgP9z9Un4LXivII_D1Hh5gZ7r9.html