Hacker News new | ask | show | jobs
by nimbleal 694 days ago
I was talking to my parents the other day and surprised myself getting pretty chocked up remembering how my dad had shown me how to program an ascii animation on his 386, and how the wonder I felt at that in many ways led me to where I am today, so many years later. These things matter.
1 comments

Do you still have the animation?
It was basically (no pun intended) this, though obviously not in bash:

  #!/bin/bash

  legs_out=(
  "                     "
  "        .'''.        "
  "       -     -       " 
  "       |  C  ^       "
  "        \    7       "
  "          | |        "
  "        /     \\     "
  "        |  \\ \\     "
  "        |   \\ \\    " 
  "      / |    \\ \\   "
  "     /  |     \\ \\  "
  "    /   |      \\ \\ "
  "   /    |      |\\  \\     "
  "        \\    \\          "
  "               \\         "
  "       /        \\        "
  "      /          \\       "
  "     /    / \\    \\      "
  "    /    /   \\    \\     "
  "   /    /     \\    \\    "
  "  /    \       \\    \\   "
  "   \\   \\       \\    \\...  "
  "     ____]         [    ]"
  )

  legs_cross=(
  "        .'''.        "
  "       -     -       "
  "       |  C  ^       "
  "        \    7       "
  "          | |        "
  "        /     \\     "
  "        |  |  |      "
  "        |  |  |      "
  "        |  |  |      "
  "        |  |  |      "
  "        |  |  |       "
  "      ( |  |  |       "
  "        |  |   )    "
  "        |  |  |      "
  "        |  |  |      "
  "        |  |  |      "
  "        |  |   )      "
  "        |  |  |       "
  "        |  |  |       "
  "        |  |  |       "
  "        /  |          "
  "       /   |  |       "
  "      \\..]  /    /    " 
  )

  print_man() {
    local spaces=$1
    local man=("${!2}")
    for line in "${man[@]}"; do
      printf "%*s%s\n" $spaces "" "$line"
    done
  }

  spaces=0
  state=0

  while true; do
    clear
  
    if (( state % 4 < 2 )); then
      print_man $spaces legs_out[@]
    else
      print_man $spaces legs_cross[@]
    fi
  
    ((spaces++))
    ((state++))
  
    if (( spaces > $(tput cols) )); then
      spaces=0
    fi
   
    sleep 0.1
  done
This is really fun, thanks for sharing. May try to do similar with my niece.
I’m afraid not. It was incredibly simple, but I just remember being amazed that such a thing was even possible.