Tuesday, 2 April 2019

For King And Country And The Prize.

Winter is easing and I made the first trek of the year into Halifax for a game with Ron.


We picked up where we left off with Osprey's naval rules and the grid. We spend a fair amount of time experimenting with trying to get as close to the off grid game without losing the benefits of clarity and simplicity that the hex grid brings.



The main issues centered around using 2" moves with 30 degree turns and 8 point wind on a grid of 4" hexes with 6 points and 60 degree angles. Doubling all moves and gun ranges would have simplifies things but robbed us of all manouevring room.

Eventually we settled on a satisfactory compromise and the game proceeded full speed ahead. We allowed ships making a single 2" move to straddle a gridline, (ie 1/2 in each hex) but to only be able to turn when reaching the centre after moving forward and to only make turns of 60 or 120 degrees . We also settled on a fire arc based on the grid pattern.

The game proceeded under full speed allowing us to focus on seamanship and tactics.

Alas the time ran out just after my brilliant manouvres had placed me in just the right spot and aspect to benefit from a sudden windshift at just the right time.  As it was I had managed to sink a ship of the line and a frigate in exchange for minor damage.

The Garrison Brewery used to use bottlecaps with a cannon stamped on them. Ron has hoarded these for years waiting for a use for thrm. Here they are marking ships that have fired.

Once you've put yourself alongside an enemy and run out the guns,  sometimes luck is all the skill you need.

I do like the game though. It reminds me of long ago days  on the West Coast, sailing Whalers and also of  Officer of the Watch  manouvres on the bridge of one of the ex-sweepers we trained on and later on a destroyer.

Tech Book Face Off: The Seasoned Schemer Vs. The Reasoned Schemer

Years ago I was led to the Schemer books by some of Steve Yegge's blog posts. It's been over two years since I've read The Little Schemer, but I enjoyed it so much that I always planned to read the sequel, The Seasoned Schemer. I recently made the time to do just that, along with working through another Schemer book, The Reasoned Schemer, that's not so much a continuation of the other two Schemer books as it is a tangential book written in the same endearing style as the others. Daniel P. Friedman and Matthias Felleisen wrote The Seasoned Schemer in the style of a Socratic dialogue, but in a much more whimsical way. A host of authors, including Daniel P. Friedman again, as well as William E. Byrd, Oleg Kiselyov, and Jason Hemann put together the questions, answers, and Scheme-based reasoning language used in The Reasoned Schemer. The real question is, are these two books as good as the original?

The Seasoned Schemer front coverVS.The Reasoned Schemer front cover

The Seasoned Schemer


Do you like learning about programming?
#t

Do you enjoy challenges?
#t

How about functional programming?
#t

And food and pictures of elephants?
Of course.

Then you probably enjoyed The Little Schemer, and you'll enjoy this book just as much. The Seasoned Schemer more or less follows the same format as The Little Schemer, and it more or less picks up where the latter book left off. What do I mean by more or less? Well, the first book leaned more toward asking questions of the reader that you could actually answer from following the line of questioning. Towards the end it became more of a dialog between two people while the reader was observing that dialog. The Seasoned Schemer definitely follows the later style of a question-answer dialogue that the reader is not so much participating in, but taking in and learning from instead.

This change of pace is not necessarily bad, though. It was just as entertaining and enlightening as before, and there were plenty of times where I sat there chuckling at the zany Q&As that were bouncing back and forth. Whenever there were questions about how to write functions or what was the result of executing functions, I attempted answering them, but there were long of stretches of dialogue that were meant more to be experienced than to be answered.

As for continuing on from The Little Schemer, the book does do that, and the authors assume the reader has read it in its entirety. However, they do remind the reader what the functions are that they defined in the first book so you don't have to go searching back to refresh your memory. They also relax the difficulty level through the first few chapters instead of continuing to ratchet it up from the high level it was left at in The Little Schemer. That's a good thing, because things were getting pretty mind-bending towards the end of the first book, and it was nice to ease back into things before getting crazy-weird again, as things do when you're learning how to implement and interpret the functions you're learning about in the language that said functions are already defined in.

They start out teaching the reader about some new functions that do various interesting things: let, if, set!, letrec, and letcc. As in the last book, the reader learns by doing, and you end up implementing a bunch of functions that modify lists of foods in various ways using these built-in functions. Then things get much more challenging as we learn how the built-in functions themselves are implemented in an interpreter written from scratch. It's an extension of the interpreter developed in the last book, and the extensions are even more difficult to comprehend because the implemented functions themselves are more difficult, especially letrec and letcc

The ramp-up in difficulty was softened somewhat by the pure whimsicalness of the dialogue, sometimes poking fun at LISPers themselves:
How many more conses does deep use to return the same value as deepM
499,500
"A LISP programmer knows the value of everything but the cost of nothing."
Thank you, Alan J. Perlis
(1922-1990).
<Next page>

But we know the value of food!

((((((((((((((((((more pizza))))))))))))))))) 
((((((((((((((((more pizza))))))))))))))))
(((((((((((((((more pizza)))))))))))))))
((((((((((((((more pizza))))))))))))))
(((((((((((((more pizza)))))))))))))
((((((((((((more pizza))))))))))))
(((((((((((more pizza)))))))))))
((((((((((more pizza))))))))))
(((((((((more pizza)))))))))
((((((((more pizza))))))))
(((((((more pizza)))))))
((((((more pizza))))))
(((((more pizza)))))
((((more pizza))))
(((more pizza)))
((more pizza))
(more pizza)
 more pizza)

Maybe it's not as funny repeated here, but then you'll just have to read the book to get the full effect. I had a blast working through it, and I couldn't put it down. The challenge of fully understanding everything in it was steep, though. I definitely will need to go back through both Schemer books to get a better understanding of how everything works, especially the later chapters. If you enjoy a challenge, don't mind a drastically different writing style for a textbook, and like having a little lighthearted fun in the process, then definitely give this book a chance. Of course, you've already read The Little Schemer, so I didn't even need to tell you that.

The Reasoned Schemer


After whetting my appetite with The Seasoned Schemer, I was ready for more scheming with this book. It should be stated that The Reasoned Schemer is not a continuation of the other two Schemer books. It goes off in a completely different direction. Instead of getting further into the theory of computation and how to build a Scheme interpreter in Scheme, this book describes and then builds a language like Prolog for logic programming in Scheme. In fact, miniKanren is derived directly from the language development of this book.

Once again I thoroughly enjoyed the Socratic dialogue format of the book, and I felt that it was an excellent way to teach and develop the material. Like The Seasoned Schemer, the dialogue seems at times to be meant to be read straight through instead of having the reader answer the questions directly. Sometimes the questions are nearly impossible to answer with the information already presented, and sometimes the answers ask questions back to the questioner. It's more of a back-and-forth dialogue that's meant to reveal insight rather than direct questions at the reader.

Even with this reader-as-observer format, the reader can attempt plenty of the questions when they are along the lines of, "how is this implemented" or, "what is the result of this code." I did notice that the examples and implementations tended to be switched around compared to the other Schemer books. In the other books, the questions would start with examples using a new function where the reader was asked to predict the results. Then the questioner would move to the implementation of the function. In this book it seemed that as often as not, the implementation questions came first, and the questions on usage examples came after the functions were described. It works both ways, and I'm not sure I have a preference.

Another difference from the other books was a toning down of the sense of humor. The Reasoned Schemer is decidedly more serious, and that was a bit disappointing. I rather enjoyed the whimsical fun of the other books. The material was still solid and interesting, though, so it's only a minor quibble.

So what does The Reasoned Schemer cover about logic programming? It starts off with explaining how equality relations work, what fresh and reified variables are, and what unification does. These are all concepts in logic programming that feel very different than other types of programming. Then discussions of conjunctions, disjunctions, and defining relations completes the foundation of logic programming so that we're ready to move on to more complex topics.

Following the basics we build up conde from conjunctions and disjunctions, and we see that conde is similar to cond in Scheme. Then we continue on, building up a number of relations that are similar to the basic functions found in Scheme, like caro, cdro, conso, nullo, pairo, etc. Notice that all of these relations end in o? That's because these functions are just like their Scheme counterparts, except that they are relations. After a few chapters of building up relations associated with familiar functions from Scheme, we delve into a classical application of mathematical logic and build up an arithmetic system from fundamentals, defining addition, multiplication, and exponentiation (and their inverses) with relations. It was really neat, I must say.

After all of these chapters on explaining the language and using it, the last chapter goes through how to implement it in Scheme. It was pretty impressive seeing the whole language built in one chapter, minus a couple functions covered in a short appendix using Scheme macros. The whole experience was super enjoyable, and I'm extremely happy to have read these unique, wonderful books. The Q&A format, the wacky humor, and the strong content made for an excellent time learning Scheme and logic programming. I didn't understand everything the first time around, but that just means I get to read them again. I'm looking forward to it. I highly, highly recommend all three Schemer books.

Now make yourself a roasted lamb shank with baked spaghetti and cheese.
Enjoy.

Monday, 1 April 2019

Pokemon Go Adding New Deoxys Form This Week

Pokemon Go Adding New Deoxys Form This Week


The Mythical Psychic Pokemon Deoxys made its debut in Pokemon Go earlier this year as the game's second EX Raid boss, replacing Mewtwo. Up until now, the DNA Pokemon has only appeared in the mobile game in its Normal Forme, but a new variant of the Pokemon is set to arrive soon.

Developer Niantic has announced that Attack Forme Deoxys will be available in EX Raids later this month. Along with taking on a different appearance, Attack Forme Deoxys has a much higher attack stat than its standard form, and Niantic warns that it will be a "difficult challenge that requires Trainers to take advantage of every opportunity."

The new form of Deoxys is set to arrive with the next cycle of EX Raid invites, which are scheduled to go out beginning December 20. Unlike standard Raid Battles, you can only participate in EX Raids if you've received an invitation. In order to get one, you'll first need to have recently won a Raid Battle at a "qualifying" Gym. These are denoted by an EX Raid tag in the upper righthand corner when you look at the Gym's details.

In the meantime, players still have a little more time to catch Pokemon Go's latest Legendary, Cresselia. The Psychic Pokemon is scheduled to leave standard Raid Battles on December 18, just before Attack Forme Deoxys is set to arrive in EX Raids. Niantic hasn't announced when the game's next Legendary Pokemon will arrive, although the developer has teased that Azelf, Uxie, and Mesprit--three more Legendaries originally from Pokemon Diamond and Pearl--are on the way.

Pokemon Go's annual holiday celebration  is also set to return again soon. This year's event kicks off on December 18 and will introduce another handful of Gen 4 Pokemon, including Snorlax's pre-evolved form, Munchlax, as well as Snover, Abomasnow, and Croagunk. Festive hat Pikachu and Delibird will also return, and different bonuses will be meted out throughout the event until it ends on January 2.