Scheme

Generating Pseudo-Random Numbers in Scheme

Recently, I needed to write a simple simulation in multiple programming languages. For the simulations to operate, they needed a source of random numbers from two statistical distributions: a uniform distribution and a standard distribution. The numbers from the distributions needed to be “random”, but not too random. I needed each generator in each language to produce the same sequence of “pseudo-random” numbers. And I needed the same sequence every time the simulators were run.

File Operations in Scheme

A little word game that I’ve been writing requires a list of acceptable words. For the game, acceptable words should be defined similarly to popular word games the player already knows like Scrabble┬« or Words with Friends. Luckily word lists for such games are readily available. For my little game, the list from Words with Friends seemed like the best choice. But it has about 175,000 English words. Way to many to use routinely in development.

Raw Terminal IO in Scheme

Recently I’ve written about doing some fairly low-level operations in Scheme, specifically how to get the window size of a terminal where the program is running. This was part of a little project to write a simple terminal-based text editor in Scheme along the lines of the kilo editor by following a tutorial entitled “Build Your Own Text Editor”. Another part of that project that was surprisingly difficult to accomplish in Scheme was putting the terminal in “raw” mode.

Getting the Terminal Window Size using Scheme

Doing some experimenting with the Scheme programming language recently has been a lot of fun. It’s even simpler in most ways than Clojure. As part of that experimentation, I’ve been looking into implementing a simple, terminal-based text editor along the lines of kilo by following along with the tutorial series “Build Your Own Text Editor”. Working through those tutorials, one of the first things that smacks you in the face is just how low-level the C programming language is and how very different it feels when compared to Scheme or, really, any other Lisp variant.