Programming Praxis put out the previous had us composing already existing PRNGs).
Programming Praxis put out the previous had us composing already existing PRNGs).
here.
First, let’s make a function that can turn any die into an unfair coin. Basically, return #t / true if and only if you roll the die twice and get the same result:
; given any random die and a possible outcome
; turn it into an unfair coin
(define (die->coin possible die)
(lambda ()
(eq? possible (die))))
From here, use the same idea that I posted about earlier to turn that unfair coin into a fair 50/50 coin:
I was reading the io9 article Why four is the nemesis of happy numbers and it got me thinking. Are there actually any cycles other than the one stated in the article? Why or why not?
Two quick bug fixes:
For the longest time, I’ve been having issues with the Dock Icon on OSX. It isn’t set using the same code that works in Windows and Linux, but I think I’ve finally figured it out.
Using information from this blog post, I can use the com.apple.eawt.Application
class to set the Dock Icon. It isn’t set immediately on launch, but shortly thereafter. Not perfect, but close.
Additional features:
[(c211 color)](http://www.cs.indiana.edu/cgi-pub/c211/wombat/docs/c211-color.htm "C211 Color API")
Bug fixes:
Added two functions to the matrix library:
(vov->matrix vov)
- converts a vector of vectors to a matrix(matrix->vov m)
- converts a matrix to a vector of vectorsQuick and simple, but highly useful for testing and display purposes.
First, a few bug fixes with the keyword lists and help links:
let
and a named let
.Also, I wrote code to generate help files for the C211 libraries. Theoretically, I should just be able to update these with future updates to the APIs:
As a side note, I’ve added two new functions to the tree API:
A new feature: any keyword can now have an associated hyperlink that points to the Chez Scheme API reference for that function. Just click on a function that you want help with and hit F1 on your keyboard. The link will open in your systems default browser. So far only the functions built into Petite Chez Scheme work correctly, I’ll be adding the C211 libraries as soon as I write the documentation for it.