Jump to content

DocSavage2001

Members
  • Posts

    37
  • Joined

  • Last visited

2 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DocSavage2001's Achievements

Space Invader

Space Invader (2/9)

72

Reputation

  1. I'll get back to you on the exact examples of cascade I was trying to use. I have it here somewhere. Dave
  2. Yeah, these are some of the issues I ran into when I was trying to implement in Atari LOGO. I did say it was a challenge! The other higher order functions I was able to get around the lack of Atari equivalents but not this one. Dave
  3. Wow! Awesome! I'm going to have to try these/this out tonight! If I get my Mastermind game running on Atari I'll share. Dave
  4. Instead of REPLACE, I created SETITEM :index :list :value to avoid that ambiguity of your second REPLACE example. For a programming challenge, how about implementing CASCADE?, a feature of FMS Logo that I used to write a Mastermind game but was/is not available in Atari LOGO. It's the one higher order function that flummoxed me putting into Atari LOGO. Dave
  5. You'll see a lot of code on my GitHub that came from or was inspired by those incredibly great Brian Harvey book series. LogoWorks by Harvey, Solomon, and Minsky is another great book. Dave
  6. Cool, I'll try it out. Neat to see some activity in this thread! Dave
  7. Yeah, sorry, I can't help with Altirra stuff with LOGO. I'm doing everything on a stock 800 with FujiNet. Dave
  8. Mentioned this already on Facebook but reporting here since forums are a little more organized. With a stock Atari 800 with Atari LOGO plugged in, FujiNet has problems coming up as shown in attached picture. I can boot FujiNet without the cartridge, mount drives and then LOGO boots up ok, so I have a workaround. Dave
  9. Ahhh, one other thing I forgot to mention about one of the great things with functional programming languages is that because they are comprised of a bunch of individual working pieces called procedures that can be all run on their own, it is easy to test your code. The odds of a naturally occurring Royal Flush are just shy of 650,000 to 1. But I don't have to run my program 650,000 times hoping to hit that condition. Right from the workspace, I can just do... PR POKERHAND [AC JC 10C KC QC] royal flush PR POKERHAND [KS 10S AS QS JS] royal flush PR POKERHAND [KS 10S AD JS QS] straight PR POKERHAND [KS JS 9S QS 10S] straight flush Dave
  10. Turns out I did need to add something more to my Logo Library of things I needed to take from FMS Logo on Windows. FMS Logo has comparison procedures called LESSP and GREATERP (The P at the end of these procedures stands for 'predicate', meaning these are functions whose output will [usually] equate to TRUE or FALSE). Atari LOGO doesn't have either of these but DOES have the corresponding 'infix' comparisons < and >. But it turns out there is an issue with using these in Atari LOGO to try to do the same things that LESSP and GREATERP do in FMS Logo. That's because Atari LOGO < and > will only take numbers (or objects that are numbers) and will not evaluate the inputs if they are functions/procedures. So... PR SUM 3 1 < DIFF 7 -2 < DOES NOT LIKE SUM 3 1 AS INPUT Even using other 'infix' operations do not work: PR 3+1 < 7-5 < DOES NOT LIKE 3+1 AS INPUT BUT... you CAN do this... (which I did) TO LESSP :A :B OUTPUT :A < :B END PR LESSP SUM 3 1 DIFF 7 2 TRUE The reason THAT works is that BEFORE evaluation LESSP, Atari LOGO looks at how many inputs LESSP wants and sees 2, then it will evaluate SUM 3 1 as the first input and DIFF 7 2 as the second input BEFORE executing the LESSP function. So I had to add LESSP and GREATERP to my updated Logo Library, which I've attached here again, both as a PDF and as a file on an .ATR. Note that this Logo Library adds MAP, REDUCE, FILTER (higher order functions), LESSP, GREATERP, ITEM, SETITEM, DIFF, a SAVE.CLEAN utility procedure and this entire library still prints out on a single page and no procedure is more than 3 lines long. Such is the beauty of recursion! I've also attached a small project I did for one of our lunch time competitions at work. It deals two hands of cards, makes sure no cards are duplicated in either hand, figures out the best poker hand possible from the dealt hand and compares the two hands to see who won. (or if they are equal.) There was another difference here between FMS Logo and Atari LOGO. FMS Logo allows you to define locally scoped objects/things, that will go away when the procedure they were defined in stops executing. All names/things/objects in Atari LOGO are global. All will be available globally scoped, so you have to be a bit careful using them compared to other functional programming languages. This program uses three TRUE pieces of global data, but these are JUST data. They are defined as part of the workspace and never are changed when the program runs. These are the listing of the four suits of cards, the 13 ranks of cards and a ranked list of poker hands from the best (a royal flush) to having nothing. The actual hands that are dealt, their poker equivalents, and some helper objects that cut down on the logic needed to figure out the poker hands, these were all locally defined in the FMS Logo version. For the Atari version, before the program ends, I call a procedure called CLEANUP that erases all these 'local' objects so you won't save them along with your workspace. This program has a few more procedures that ARE over three lines long, but if you look at them closely, they all share one common denominator. They do their work in a sequential fashion instead of using recursion. If you want to play around with it, I've attached the PDF for both the LogoLib and the Poker program. If you take the disk image, make sure to load BOTH files to your LOGO workspace. You can execute the program by typing POKER. If you change or add something to the POKER program, be sure to use SAVE.CLEAN not the built-in SAVE. NOTE this program is slow. The Atari LOGO implementation CAN do the higher order functions but it wasn't built for it. So it can chug along at times. But the point of this exercise wasn't to write commercial quality code, just to show off the 40 year old Atari LOGO can do some major recursive tricks, which makes it one of the few Atari native languages that can do that. Just remember to RECYCLE often to reclaim NODES. (You can see free NODES left by doing a PR NODES.) Dave LOGODISK.ATR LOGOLIB.pdf POKER.pdf
  11. Well, THANK YOU #FujiNet, now I can attach LOGO program listings as PDFs instead of having to take screen shots of my procedures. Tonight, I've finished off my Atari LOGO library of useful procedures that are not already built into the primitives of the language. Most of these are procedures I used heavily in FMS Logo on Windows so I could translate some of those FSM Logo programs I wrote into Atari LOGO. I added two more since last time, but the attached PDF has all the current procedures in my "utility" library. The two I added: SETITEM :INDEX :LIST :VALUE The corollary to ITEM :INDEX :LIST - Instead of returning the INDEXth item in a list, it replaces the INDEXth item of a list with VALUE. These routines in Atari LOGO are actually 'cleaner' than they are in FMS Logo because FMS Logo doesn't support ITEM or SETITEM on lists only arrays (which Atari LOGO doesn't have). So, in FMS Logo, when I wanted to use ITEM or SETITEM on a list, I would have to convert the list into an array, then use ITEM/SETITEM and then convert the array back into a list. These procedures just work directly on lists without conversion. SAVE.CLEAN :FILENAME The problem with using a library of utility procedures in Atari LOGO is that when you write your own programs, if you save them, Atari LOGO will save the entire workspace including all the utility procedures along with your program. FMS Logo gets around this because in FMS Logo, you can 'bury' utility library procedures so they aren't seen as part of the workspace, even though they are there. So, I created this procedure so you can do a clean SAVE of your Atari LOGO programs WITHOUT any of the utility procedures getting saved along with your program. I do this by erasing all the utility procedures and then doing a SAVE. Note that a) SAVE.CLEAN can even erase itself and it will still work and b) that ";" is actually a procedure name, not a formatting command or a comment. Now that the library of things I need (and you will probably find them useful too if you do much LOGO stuff), I can start doing an actual program that does something! Coming up... Dave LogoLib.pdf
  12. Ironically, the reason I used "LOGO" was specifically to identify I was talking about the programming language because that's how Atari referred to it, in all upper case. (Though they weren't always consistent about that.) I would have used "logo", all lower case to talk about graphical type logos. But no worries, the Lucasfilm logos are cool too! Dave
  13. I am having the same issue, but I sent the files in a PM here on this forum to Bertrand (the previous poster) and he got them added. Dave
  14. My FujiNet is coming tomorrow and I'm trying to set up the TNFS Server part tonight on my PC and trying to piece together all the information to make that work. I think I got it down to (which I'm paraphrasing from a post made by Thom sometime in the past): CMD cd C:\tnfs <-- directory I put tfnsd.exe in, then... tnfsd C:\Atari Resources\TNFS data But then I'm getting an error saying this doesn't work on my 64-bit Windows PC "This version of C:\tnfs\tnfsd.exe is not compatible with the version of Windows you're running.". I guess I'm not using the right version? Where is the right version? Thanks for any pointers! Dave
×
×
  • Create New...