• Home
  • About
    • About The Coder
    • Language List
  • The Rules
    • Rule #1: Clarity Trumps Everything
    • Rule #2: Source Code is for Humans
    • Rule #3: Don’t Ignore Warnings
    • Rule #4: Comment As You Go!
    • Rule #5: Always Use Parentheses
  • CS-101
  • Guestbook

The Hard-Core Coder

~ I just can't stop writing code!

The Hard-Core Coder

Category Archives: Fun

Multiplication Visualized

01 Tuesday Sep 2020

Posted by Wyrd Smythe in Fun

≈ 1 Comment

Tags

Cartesian product, Japanese multiplication method, multiplication, Pillow (PIL fork), Python, Python code

On my regular blog I just posted about a Japanese visual multiplication method. It’s a cute trick that ties into the notion of grid multiplication techniques. (In general, multiplication techniques are of some interest due to the Mandelbrot set, which requires multiplying large numbers lots of times.)

It turns out code to generate the patterns was a lot easier than I thought it would be. The hardest part was generating the diagonal summing lines.

Continue reading →

Square Root of 2

15 Friday May 2020

Posted by Wyrd Smythe in Fun

≈ Leave a comment

This post contains some simple code for calculating the square root of 2 and then generating the bits of the value.

It’s a companion to a post on my other blog.

Continue reading →

Life With Class

07 Thursday May 2020

Posted by Wyrd Smythe in Fun

≈ Leave a comment

Tags

computer code, Conway's Life game, John Conway, program, Python code

Last time I showed you the functions necessary for Life — for John Conway’s game of Life, that is. We ended up with a set of functions you can use to generate frames of a Life session.

This time I’ll show you an object-oriented version (a Life class) along with some other tweaks to make things look nicer.

Continue reading →

John Conway’s Life

03 Sunday May 2020

Posted by Wyrd Smythe in Fun

≈ Leave a comment

Tags

computer code, Conway's Life game, John Conway, program, Python code

You may have heard that mathematician John Conway died last April. To his everlasting dismay, most people only know him for his “game” of Life (which he considered trivial and inferior to his real mathematical work). Unfortunately for Conway, his Life game is fascinating.

To honor his passing, I whipped up a Python version that I thought I’d share. Python is about the only language I’ve used a lot in which I’ve never implemented Life, so high time I did, right?

Continue reading →

The Playfair Cipher

27 Sunday Oct 2019

Posted by Wyrd Smythe in Fun

≈ 1 Comment

Tags

cipher, computer code, Python code, secret codes, substitution cipher

Earlier this month, on my other blog, I wrote about the Playfair Cipher, a polygraphic substitution cipher invented by Sir Charles Wheatstone in 1854.

At the time I mused about writing some Python to automate using the cipher, and now I’ve done that, so here it is:

Continue reading →

The Eight Queens

23 Sunday Jun 2019

Posted by Wyrd Smythe in CS101, Fun

≈ Leave a comment

Tags

Python, Python code

There’s a fairly simple puzzle, called The Eight Queens, that I’ve long favored as a project for first semester CS students. The problem is simple enough for a beginner to tackle, yet also interesting enough to be engaging. (And just tricky enough to be a nice beginner challenge.)

Due to a discussion on my other blog, I dug out an old Python implementation I had, and, after looking at it, I thought it might be worth writing a post about. If nothing else, as I said, the problem is interesting enough to be engaging.

Continue reading →

Adventures in Address Vector Space

10 Friday May 2019

Posted by Wyrd Smythe in Fun

≈ Leave a comment

Tags

Python, vector math, vector space

Lately I’ve been exploring the idea of a vector space with a large number of dimensions (but few degrees of freedom). A model was presented with five degrees of freedom in 500 dimensions (neurons, as it happens).

The question is, given the axes are bit-level, does normal vector manipulation semantics make sense. My contention is it has severe problems.

Continue reading →

Number Games #1

22 Friday Mar 2019

Posted by Wyrd Smythe in Fun

≈ Leave a comment

Tags

Collatz conjecture, multiplicative persistence, Python code

This is a companion post to the Math Games #1 post on my main blog.

Here I present some code (Python, of course) for exploring the first two games, multiplicative persistence and the Collatz conjecture.

Continue reading →

So Random!

01 Tuesday Jan 2019

Posted by Wyrd Smythe in Fun

≈ 2 Comments

Tags

Python, Python code, random

To ring in the new year I thought I’d play around with an old friend from my earliest programming days, a random text generator. Back then (over 30 years ago), but a little bit always, a good way to practice programming is by working on small, relatively easy, but still fun, programs.

Simple games are common choice, but not the only one. (I’ve probably written a version of Mastermind in every programming language I know.) Another fun choice is various image or text generators (or processors). Random text generators, in particular, offer a range of complexity depending on your taste and time.

Continue reading →

Good Ol’ BASIC

13 Saturday Aug 2016

Posted by Wyrd Smythe in Fun

≈ Leave a comment

Tags

BASIC, free verse, poetry

Here’s a free verse ode to my very first computer programming language, good old BASIC:

Continue reading →

← Older posts
Follow The Hard-Core Coder on WordPress.com

The Posts

  • Brian Kernighan: Successful Language Design
  • My Python App Framework
  • Multiplication Visualized
  • Square Root of 2
  • Life With Class
  • John Conway’s Life
  • Python Decorators, part 2
  • Python Decorators, part 1
  • Function Currying
  • Rule #5: Always Use Parentheses

The Topics

  • Blog (4)
  • CS101 (28)
  • Fun (22)
  • Interesting (1)
  • Opinion (12)
  • Stories (12)
  • Uncategorized (1)

The Month

January 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Oct    

The Past

It’s me!

Wyrd Smythe

Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts.

View Full Profile →

The Main Blog

Visit Logos con carne

Lots of wyrds... with meat!

Posts

RSS Feed

Comments

RSS Feed

Enter your email address to follow The Hard-Core Coder and get email when there is a new post.

Blog at WordPress.com.