Skip to content

Instantly share code, notes, and snippets.

@tompng
Last active April 18, 2025 09:20
Show Gist options
  • Save tompng/503b850cd7f7d75a15aa3bd0198ed7f2 to your computer and use it in GitHub Desktop.
Save tompng/503b850cd7f7d75a15aa3bd0198ed7f2 to your computer and use it in GitHub Desktop.
Code Party TRICK, Reline, IRB

Code Party: IRB/Reline/TRICK

Self Introduction

These are just an idea.

Let's read TRICK codes

Let's encode and decode data in a strange way

  • Encode to a string "UnVieQ=="
  • Encode to a structure [{},[{},[[],[],{}],{}]]
  • Encode to method names obj.puts.quot.hello.ruby.quot
  • Encode to method calling order +-++--+++-+obj

Let's use ANSI escape codes to display texts freely on the terminal

Reline is rendering the terminal with ANSI escape codes. Some of the TRICK entries also uses it.

  • Move cursor "\e[#{y};#{x}H"
  • Clear line "\e[K"
  • Change color "\e[#{color}m"

Let's see and solve IRB or Reline issues

Let's write TRICK codes

  • Quine
  • Restricted programming

Share your TRICK idea, write, brush up, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment