r/shittyprogramming • • May 02 '21

Tower of Code: isEven(n)

Welcome to Tower of Code! In Tower of Code, the goal is to make code such that each line is smaller than the next, whilst being as tall as possible. For a simple example, the following function, which just returns true, is a valid tower:

         function t(){
        {{{{{{{{{{{{{{{
       {{{{{{{{{{{{{{{{{
      {{return true;}}}}}
     }}}}}}}}}}}}}}}}}}}}}
    }}}}}}}}};;;;;;;;;;;;;;

Your goal is to make a tower for the isEven function, which has the following specification:

        _____                   __       __
 ()     | __|                  / /       \ \
 __  __ | |_¯__  __ __  __    | /  __     \ |
 || / _)| _| \ \/ // _\ | ¯¯\ { }  | ¯¯\  { }
 || _¯\| __ \  / |{_/ ||¯|| | \  ||¯||  / |
 || (¯ /|   |  \/  \  ¯)|| ||  \ \ || || / /
 ¯¯  ¯¯ ¯¯¯¯¯       ¯¯¯ ¯¯ ¯¯   ¯¯ ¯¯ ¯¯ ¯¯
   /====================================\
   |   Determines if a number is even   |
   |-----------------.------------------|
   |   Example Input | Example Output   |
   |-----------------+------------------|
   |              12 |             true |
   |              35 |            false |
   |              56 |             true |
   |              73 |            false |
   |              92 |             true |
   |             147 |            false |
   \====================================/

Rules for towers:

  1. Every line must be smaller (have fewer characters) than the next
  2. To be a tower, it must be at least 6 lines tall
  3. The code must work reliably
  4. Good style is encouraged, but should not get in the way of towering.
106 Upvotes

40 comments sorted by

View all comments

Show parent comment

2

u/auxiliary-character May 04 '21 edited May 04 '21

Oh, I was considering the body of the function to be the tower, I hadn't considered the label.

Guess I could replace the first line with add rax, 1.

2

u/RFC793 May 04 '21

I don’t really know, I was just being pedantic.