Skip to content

Instantly share code, notes, and snippets.

View YingCGooi's full-sized avatar

Ying Chyi Gooi YingCGooi

View GitHub Profile
<select name="state">
<option>AK</option>
<option>AL</option>
<option>AR</option>
<option>AZ</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DC</option>
<option>DE</option>
<!doctype html>
<html lang="en-US">
<head>
<title>Nav Page</title>
<meta charset="UTF-8" />
<style>
body {
margin: 0;
padding: 0;
}

Understanding Minilang-written Math Expressions

This post is intended to provide a walk-through to better understand how we can write math expressions in terms of minilang. I would like to share my approach here on tackling the Further Exploration section in 101-109 Medium 1 Exercise on Stack Machine Interpretation.

In minilang, numbers are passed into the stack program in reversed order. The stack program operates such that:

  1. The latter value is first pushed to the stack
  2. The former value is assigned to the register
  3. The register pops the latter value from the stack and performs an operation with its value
  4. The return value of the register can then be used to repeat the process from 1 for multiple values

A Flexible Bannerizer Program Written in Ruby

This is originally intended to be a further exploration attempt in one of the exercise problems in Launch School. Since I wanted to test my knowledge, I took the challenge and wrote an original solution. I am also training my fluency in explaining a code line-by-line, which is encouraged by Launch School. Thus, I created a detailed analysis. Before we dive into the analysis, let's do a quick summary of what this program does.

This bannerizer program takes a string as input, and outputs it within a box. For example:

print_in_box('')
+--+
|  |
| |