How can we convert in a program from words like “eight” to the number 8? How can we convert the number 10 to the letters “Ten”? Here, I show you multiple ways to do it bi-directionally…from letters to digits, and digit to letters. I’ve seen several implementations and many rely on ASCII ordinals. But I […]
Tag: https://tonyr.carrd.co
The world’s first “smart”-phone
It was in the late 90s when, fresh out of university, I got my first real career job at now defunct Geoworks based in Alameda, CA (their Seattle resources taken over by Amazon.com since). They built the embedded platform on Unix for various mobile devices including PDAs, beepers and such (remember those?). I was on […]
Adding sound to Python code
Python isn’t necessarily for multimedia programming, so only recently I looked up ways to add audio in a Python script. Turns out there are several ways to do that. They’re all really simple. Methods to add sound: 1. import winsound fname = “soundfile.wav” winsound.PlaySound(fname, winsound.SND_FILENAME) 2. import pygame pygame.init() s = pygame.mixer.Sound(“soundfile.wav”) # Start playback […]
Program to care for a pet (Scratch)
Hello, and welcome back. Today, A fun program to introduce kids/beginners to understand logic and loops while taking care of a pet fish 🙂 Easy to code and easy to play. Code is commented with explanation. Check it out here: https://scratch.mit.edu/projects/282372671/ Enjoy! Challenge: I intentionally kept the core code simple and uncomplicated. However, if you grasp the […]
Playing with Clay
Hey there, so I got some fresh reusable and permanent clay materials from Michael’s. Goofing with the reusable one just to feel the texture, created this figure. I’ll call it “Penguin Man protecting his first-born” I kinda like him actually! More unique posts like this are quickly found from this link (because I tag them accordingly).
Abstract Art with Code (Art<->Tech). Volume III
VOLUME 3 If arts and tech had a baby, may it’d look like me 🙂 Anyway, I love mixing the two, interconnecting, and interpolating them…because I’m always curious. Results can be incredibly satisfying or surprising. These are not the best of my work in any form in coding, but wanted to share these short programs […]
Abstract Art with Code (Art<->Tech). Volume II
VOLUME 2 If arts and tech had a baby, may it’d look like me 🙂 Anyway, I love mixing the two, interconnecting, and interpolating them…because I’m always curious. Results can be incredibly satisfying or surprising. These are not the best of my work in any form in coding, but wanted to share these short programs […]
Abstract Art with Code (Art<->Tech). Volume I
VOLUME 1 If arts and tech had a baby, may it’d look like me 🙂 Anyway, I love mixing the two, interconnecting, and interpolating them…because I’m always curious. Results can be incredibly satisfying or surprising. These are not the best of my work in any form in coding, but wanted to share these short programs […]
Drawing Graphics using Python (Turtle)
In this blog, I show you how to use draw graphics in Python. Objective: I want to draw dots (circles, really if they’re larger than a pixel)…of different sizes and colors at various locations multiple times (I chose 100X for this demo). This is how the output looks like: Source Code: The complete source is below. […]
Creating Magic 8 Ball Game in Python
Howdy! If you’re getting tired of Magic 8 ball game implementations in different languages, I have good news. I’ll stop (for now) with this last variant…this, in Python. The simplest, quickest code block happens to be in Python…as far as logic goes. In order to do graphics, animation, sound stuff, it’s not that great as […]