StoutPanda The Bamboo Grove

18XX Primer

18xx 101

Here’s a tutorial for 1889 on the 18xx.games platform: 18xx Games Tutorial. It walks you through turns of a three-player game, illustrating typical gameplay elements.

For 18xx games, most are derived from 1830 with modifications (sometimes significant ones that the community refers to as “McGuffins”). Key variations include the maps, available companies, tile availability, and train rules. Additionally, auction methods for companies, stock market mechanisms, and company-specific rules often differ, leading to uniquely challenging games.

Although 1830 is one of the earliest 18xx games, it followed the lesser-known 1829. 1830 is the foundation for most other 18xx games.

18XX Chart

The more introductory games like 1889, 18Chesapeake, and 18MS, which are based on financial strategies from 1830. These games focus on timing investments and manipulating stock prices. The most significant game in this financial category is 1817, which can last over 12 hours due to its complex stock market dynamics.

Another category within the 18xx series focuses on operational games, such as 1846, designed by the creator of Race for the Galaxy. 1846 emphasizes efficient company operation, route competition, and critical timing of train upgrades, making it an accessible entry point for those new to operational strategies within the 18xx series. 1822, another significant game in this genre, is known for its lengthy gameplay and intricate management of private companies, but it may not be as suited for beginners due to its complexity.

Gameplay typically alternates between Stock Rounds and Operating Rounds, which may vary in number as the game progresses. During Stock Rounds, players buy and sell shares, affecting company valuations. In Operating Rounds, companies operate trains, manage routes, handle dividends, and invest in new trains. A crucial tip for beginners is to prioritize train purchases, which can accelerate game progression and disrupt opponents’ strategies.

Trains, which have finite lifespans, need careful management to prevent obsolescence and ensure operational efficiency. Newer trains make older models obsolete (“rusting”), forcing players to continually adapt their strategies. Companies are usually divided into public and private. Private companies, often starting smaller, can later be integrated into public ones, providing strategic financial benefits. Company funds stem solely from share purchases, and operational decisions during rounds can significantly impact overall success.

Tracks are categorized into three types: Yellow, Green, and Brown, representing different stages of development. Starting with Yellow, players can upgrade to Green and then Brown, each providing different strategic options. Tile availability is typically limited, encouraging strategic placement to potentially hinder opponents’ expansion.

During Operating Rounds, per train you can run a route where track cannot be reused by your company for multiple routes. You can’t backtrack normally. The number of stations a train visits, typically its numeric value like a “2 train” or a “4 train,” is crucial as it dictates the potential revenue from that route. Each station adds a set value to the route’s total income, influencing strategic decisions about train operations and route planning.

Here is an example board from a completed 1889 game: 1889 Finished Game

Example: If you had a station in Nahari, and two “2” trains, you could run two routes. One from Muroto to Nahari for 40 dollars, and one from Nangoku to Nanari for 30. A total of 70 for the operating round.

If you had a 3 train, you could run between Muroto to Nanori to Nangoku for 50, or if you additionally had a station in Kouchi and a 3 train, you could run to Kouichi to Nangoku to Nanari for 90.

You may not reuse track during a route, but you may visit a station with multiple trains as long as you do not resuse track.

TigerVNC Server & Ubuntu 16.04 Xenial Xerus

Today I tried to install TigerVNC Server on Ubuntu 16.04, and was surprised to find that Ubuntu still uses TightVNC in their main repos. Additionally, there are no PPAs for TigerVNC and Ubuntu 16.04 Xenial Xerus yet.

Installing it is simple:

+Download the latest binary from TigerVNC. At the time of writing, version 1.7.0 for Ubuntu is located here for 64bit and here for x86. Latest release information can be found on the (TigerVNC github page)[https://github.com/TigerVNC/tigervnc/releases].

Then run:

sudo dpkg -i tigervncserver_filename.deb

sudo apt-get install -f

vncserver

You will be prompted for a few questions the first time you start it up, but that it is it. Your VNC Server is up and running on port 5901 by default. You can connect to it using the Tiger VNC viewer on another computer by pointing it to the IP:5901.

There are a lot of options for TigerVNC server, but one of my favorite things about TigerVNC is that the connections are encrypted by default. However, I recommend only connecting to VNC servers over VPNs or SSH tunnels just to be sure.

Elixir & Pattern Matching

Before starting with Elixir, I had no functional programming experience. Many of the concepts that are central to using it are very new ideas for me. Prior to this, I only had minimal exposure to lisp when editing a few emacs/spacemacs configuration files.

I’ve only begun to dabble with it, but I am already in infatuated with the power of Pattern Matching. Pattern matching makes things simple. That’s the simplest description I can think of for it.

I had the mind-blowing moment when working with a simple common programming challenge: Fizz Buzz.

Fizz Buzz has of course been done to death on the web, see enterprise Edition Fizz Buzz, but I still can’t get over how simple it was to implement this in elixir.

Fizz Buzz: Requirements: *For numbers 1 through 100, *if the number is divisible by 3 print Fizz; *if the number is divisible by 5 print Buzz; *if the number is divisible by 3 and 5 (15) print FizzBuzz; *else, print the number.

Let’s take a look at the implementation in ruby:

1.step(100,1) do |i|
   if (i % 5) == 0 && (i % 3) ==0
    puts 'FizzBuzz'
   elsif (i % 5) == 0
    puts 'Buzz'
   elsif (i % 3) == 0
    puts 'Fizz'
   else
    puts i
   end
end

And now for the pattern matching version in elixir:

fizztest = fn
    (0, 0, _) -> "FizzBuzz"
    (0, _, _) -> "Fizz"
    (_, 0, _) -> "Buzz"
    (_, _, n) -> n
  end

fizzbuzz = fn (n) -> fizztest.(rem(n, 3), rem(n, 5), n) end

IO.inspect Enum.map(1..100, fizzbuzz)

In elixir, we don’t have to use if statements, or cases. We can define the pattern we are looking for and then return the output we want. We use two anonymous functions, (between the fn & ends) and base the pattern on the return of modulus division (the rem function).

What I find very interesting about pattern matching, is that it comes off very readable and understandable, even when you are not that familiar with the language. Additionally when reviewing the code, there is simply one function call to another, looking for pattern after pattern. It leads me to doing less of this, and leads me to more time spending thinking about what I want to accomplish. While I haven’t built anything noteworthy in it yet, I hope that this pattern continues (slightly more boilerplate code, but much easier to return the project after being away a few days).

For a great introduction to pattern matching and other functional programming concepts, you should check out a series of blog post on medium: So you want to be a functional programmer.

New Jekyll Site

def foo
  puts 'Hello World!'
end

That’s how all great things start out, right?

Today, I’m pushing up the first post on a new jekyll site that I hope to use as my blog and documentation of a few things.

I’ve been in IT for about a decade as support and systems administration, and now I’m trying to pick up a few new skills on the coding side of the computer world. I also dabble in quite a bit of homelab setups, so I hope to include post covering all of these topics.

On the systems administration side of things, I’ve had the pleasure of working with everything from Pick OS to modern Linux.

On the coder side, I’ve dabbled in it from time to time over the years, but finally found that it “clicked” when learning ruby. Right now I’m working on beefing up my front end web development skills, and then if it all works out learning elixir / earlang as I think the BEAM VM is a wonderful creation and that many applications will utilizing to it as elixir/phoenix gain more popularity.

I still have lots to learn about Jekyll, and once I wrap my head around it I have a write up of a recent homelab restructure that I plan to publish.