Тёмный

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

8-Bit Show And Tell
Подписаться 56 тыс.
Просмотров 34 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 210   
@sypialnia_studio
@sypialnia_studio 4 года назад
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 2 года назад
Oh yeah he's the Bob Ross of vintage computing.
@Groose1972
@Groose1972 4 года назад
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 года назад
Aha, thank you!
@Groose1972
@Groose1972 4 года назад
@@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 года назад
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 года назад
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 года назад
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 года назад
LOGO programmers , probably ...
@RamLaska
@RamLaska 4 года назад
@@redsmith9953 Or Apple ][ users ;)
@RamLaska
@RamLaska 4 года назад
@@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
@75slaine
@75slaine 4 года назад
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 🤔
@staglomagnifico5711
@staglomagnifico5711 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.
@SimonCoates
@SimonCoates 4 года назад
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 😁
@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.
@stephanevermette145
@stephanevermette145 4 года назад
I loved Transactor magazine! I used to buy it around 1983-84...
@vaclavtrpisovsky
@vaclavtrpisovsky 4 года назад
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 года назад
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
@chainq68k
@chainq68k 4 года назад
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 года назад
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.
@JefesGarden
@JefesGarden 4 года назад
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 года назад
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.
@christopherpow8053
@christopherpow8053 4 года назад
Thanks for the trip down memory lane! I wrote many Logo programs in the 80s. It was so much fun!!
@kissingfrogs
@kissingfrogs 4 года назад
that was an awesome Pi experiment, I was so willing it to converge on Pi
@logiciananimal
@logiciananimal 4 года назад
Logo is basically a dialect of LISP. Some interpreters, like LogoWriter from LCSI allow for proper whitespace for ease of reading.
@duuqnd
@duuqnd 4 года назад
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.
@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 года назад
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 года назад
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?
@joebloggs3116
@joebloggs3116 4 года назад
This is awesome man, nerding us out big time with that logo flashback. Thanks for all the great content.
@wimwiddershins
@wimwiddershins 4 года назад
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.
@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.
@UReasonIt
@UReasonIt 4 года назад
Wow, the Transactor magazine brings back a lot of memories!
@rossdtool
@rossdtool 4 года назад
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 года назад
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 года назад
@@nat14159 amazing that you noticed that. Also, my dad's name is Tom and he was a mathematition, specialising in semi groups.
@ColinTimmins
@ColinTimmins 4 года назад
This brought back memories... “Turtle Turtle!” 🐢
@nohjrd
@nohjrd 4 года назад
Brilliant video! You did an amazing job explaining everything an keeping it interesting and engaging.
@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 года назад
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.
@madyogi6164
@madyogi6164 4 года назад
Very educative and cool fun with toys from the attic.
@0fend0
@0fend0 4 года назад
I spy an M83 fan! Great video as always!
@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.
@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
@ronpetrick
@ronpetrick 4 года назад
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.
@The.Doctor.Venkman
@The.Doctor.Venkman 4 года назад
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 года назад
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.
@MichaelDoornbos
@MichaelDoornbos 3 года назад
Had to revisit this video today since it's Pi Day again ;-)
@G.B...
@G.B... 4 года назад
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 года назад
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 года назад
@@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.
@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. :)
@Kajico
@Kajico 4 года назад
That ending song for some reason reminded me of Square One PBS show. It would definitely fit right in with that show
@JoostSmits
@JoostSmits 4 года назад
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 года назад
Googling for Commodore Logo or C64 Logo was not returning many results about the Logo programming language!
@collectivesartori
@collectivesartori 4 года назад
Logo! Wow. Blast from the past.
@fabronfretwell3257
@fabronfretwell3257 4 года назад
Happy PI day!
@RamLaska
@RamLaska 4 года назад
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.
@nneeerrrd
@nneeerrrd 4 года назад
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 ;)
@kduhtdkzrt
@kduhtdkzrt 4 года назад
I‘d absolutely love more videos on Logo.
@judgegroovyman
@judgegroovyman 4 года назад
kduhtdkzrt yeah me too!
@ThomCote88
@ThomCote88 4 года назад
This is awesome, I'd love to see more Logo videos
@NeilRoy
@NeilRoy 4 года назад
Great video. I remember some turtle graphics programs for the C64. I always loved that sort of thing.
@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.
@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 😀
@roaddan01
@roaddan01 4 года назад
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 2 года назад
10 IMPRIME "BONJOUR MONDE" 20 VA A 10 COURS
@rorykurek643
@rorykurek643 4 года назад
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...
@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
@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.
@Synapsenplatzer
@Synapsenplatzer 4 года назад
Excellent video! So entertaining to learn something new!
@weedmanwestvancouverbc9266
@weedmanwestvancouverbc9266 4 года назад
Did you play around with some of the oddball stuff like the VIC 1520 plotter? Any tales related to Jim Butterfield?
@bwack
@bwack 4 года назад
Thanks! Fun experiment on computing pi. Loving your videos!
@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.
@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.
@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.
@GeoffSeeley
@GeoffSeeley 4 года назад
@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 года назад
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.
@bgelais
@bgelais 4 года назад
I remember that good old time of LOGO.
@console
@console 4 года назад
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
@RamLaska
@RamLaska 4 года назад
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 года назад
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 года назад
@@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.
@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.
@LMacNeill
@LMacNeill 4 года назад
12:26 -- looks like something drawn by a Spirograph. Anyone remember that toy from the '70s and early '80s?
@judgegroovyman
@judgegroovyman 4 года назад
LMacNeill I thought the same thing! Spirograph was awesome!
@AureliusR
@AureliusR 2 года назад
Was really hoping you would do more with Logo -- have you done another video about it?
@csbruce
@csbruce 4 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eabOVMxn8iw.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 года назад
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 >'.
@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.
@misterjib
@misterjib 4 года назад
Oh wow, i remember using what must have been logo turtle on a bbc micro at middle school, 82 or 83.
@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
@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)
@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
@Lilithe
@Lilithe 4 года назад
Have you done a video on the SuperCPI? That seems pretty neat. :D
@andlabs
@andlabs 4 года назад
(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 года назад
I haven't done a video dedicated to the SuperCPU yet; I should!
@mikekopack6441
@mikekopack6441 4 года назад
Damn, now I really want a SuperCPU...
@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)
@orangetiki
@orangetiki 2 месяца назад
Could we get a video of logo os? It looks fascinating
@HuntersMoon78
@HuntersMoon78 4 года назад
Wonder what speed the ZX Spectrum Next can calculate pi.
@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.
@Uterr
@Uterr 4 года назад
so what result will be, if you simply fill inside of circle not using monte carlo?
@Mr_ToR
@Mr_ToR 4 года назад
Dear Robin, I'm experiencing a strange issue with Commodore Basic. I use UART from user port to Arduino, which controls lego robot with cheap servos. When i OPEN 5,2,0,CHR$(10), I can send with ?#5,"something". However if I have a variable declared before OPEN, the variable is lost after OPEN. Similarly, any variable declared after OPEN is also lost after CLOSE. Am I missing something? How can one transfer a variable to the user port????
@Mr_ToR
@Mr_ToR 4 года назад
Similarly if OPEN is reached with GOSUB, it looses where it was coming from too and can not do a RETURN after CLOSE and you get a return without gosub error. Very strange...
@8_Bit
@8_Bit 4 года назад
Yes, this is a dumb feature of Commodore BASIC that I only learned when I did the Information Society episode, as I was trying to write a C64 BASIC program to display the modem-encoded text. A CLR is performed when the RS-232 routines are initialized, because buffers are created in BASIC memory space when the file is opened and so memory gets re-organized. The only solution that I know of is to OPEN right at the beginning, and then only CLOSE at the very end. If you must keep some information, then I think it needs to be POKEd into memory (maybe at 49152 and on) and then PEEKed back into variables later.
@Mr_ToR
@Mr_ToR 4 года назад
8-Bit Show And Tell, Thnx for confirming my suspicions. I actually transferred all the variables back and forth with poke/peek around open-close ($C000) However it slows everthing even more so i was considering putting everything inside open-close. 👍👍
@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!
@andlabs
@andlabs 4 года назад
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 года назад
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.
@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.
@belstar1128
@belstar1128 4 года назад
Cool make some more video's about logo i remember hearing about it but i never saw it being used
@Sharklops
@Sharklops 4 года назад
Here are a couple of my favorite interesting ways to calculate Pi: Buffon's needles: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sJVivjuMfWA.html\ Elastic collisions: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-abv4Fz7oNr0.html
@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.
@gabrielsroka
@gabrielsroka 4 года назад
Is Logo compiled? Interpreted? Both? It's too bad the built in Basic editor/environment wasn't as nice as Logo.
@8_Bit
@8_Bit 4 года назад
I don't know much about how it works internally, but I think it's parsed and tokenized when you hit CTRL+C to exit the editor, and then those tokens are interpreted when run. So it's faster (and takes less memory) than a purely interpreted language.
@razberry636
@razberry636 4 года назад
Compilers are more difficult to write than interpreters. I don't know much about C64 Logo, but the modern standard of Logo (UCBLogo) has features that would be difficult to implement in a compiled language.
@AntonioBarba_TheKaneB
@AntonioBarba_TheKaneB Год назад
Microsoft Excel in Italian also has all the commands translated! That’s a freaking nightmare
@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!
@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: ru-vid.com/group/PLvW2ZMbxgP9z9Un4LXivII_D1Hh5gZ7r9
@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. :)
@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 :(
@misterjib
@misterjib 4 года назад
What happens when the point is on the circumference. Incirc?
@WarrenPostma
@WarrenPostma 4 года назад
Happy Pi Day!!!!
@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.
@landsgevaer
@landsgevaer 4 года назад
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!
@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.
@Breakfast_of_Champions
@Breakfast_of_Champions 4 года назад
8-bit magic!
@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
@logicone5667
@logicone5667 4 года назад
I literally thought you meant the chicken lips at first.. lol
@jack002tuber
@jack002tuber 4 года назад
I had something like logo. Is there one call turtle graphics? Mine had the pen up pen down and left and right, looked like this
@8_Bit
@8_Bit 4 года назад
Yes, HES or HesWare (they seemed to use two names?) made a Logo-like language called Turtle Graphics. I'm not sure if they changed aspects of it to "improve" it, or just to avoid licensing fees?
@billyjoejimbob75
@billyjoejimbob75 4 года назад
What? 9000 decimal places? Wish I could've had it on the VIC 20.
@Eightbitswide
@Eightbitswide 4 года назад
Logo sprites and music?
@VicGreenBitcoin
@VicGreenBitcoin 4 года назад
Can you do a Bitcoin hash?
@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 года назад
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.
Далее
Book Club: Commodore 64 Programmer's Reference Guide
40:16
What on Earth Is This Thing?
16:54
Просмотров 95 тыс.
Adding Hex Support To C64 BASIC
28:29
Просмотров 21 тыс.
Commodore 64 COBOL For Fun And Profit?
21:25
Просмотров 51 тыс.
Harder Drive: Hard drives we didn't want or need
36:47
The world's worst video card?
32:47
Просмотров 6 млн
Exploring the SuperCPU Accelerator for C64
29:13
Просмотров 107 тыс.