text:
The Baum-Sweet Sequence
The Baum-Sweet Sequence (A086747 with a Twist)
Take in a positive integer n and print the integers from 1 to n for which the Baum-Sweet sequence returns true. The Baum-Sweet sequence should return falsy if the binary representation of the number contains an odd number of consecutive zeros anywhere in the number, and truthy otherwise. For more information, click the link. Here's a couple of examples:
1 -> 1 -> Truthy
2 -> 10 -> Falsy
3 -> 11 -> Truthy
4 -> 100 -> Truthy (Even run of zeros)

Here's an example given n=32
Step 1: The Baum-Sweet sequence visualized for n=32
1               1 (1)
1 0             0 (2)
11              1 (3)
1 00            1 (4)
1 0 1           0 (5)
11 0            0 (6)
111             1 (7)
1 000           0 (8)
1 00 1          1 (9)
1 0 1 0         0 (10)
1 0 11          0 (11)
11 00           1 (12)
11 0 1          0 (13)
111 0           0 (14)
1111            1 (15)
1 0000          1 (16)
1 000 1         0 (17)
1 00 1 0        0 (18)
1 00 11         1 (19)
1 0 1 00        0 (20)
1 0 1 0 1       0 (21)
1 0 11 0        0 (22)
1 0 111         0 (23)
11 000          0 (24)
11 00 1         1 (25)
11 0 1 0        0 (26)
11 0 11         0 (27)
111 00          1 (28)
111 0 1         0 (29)
1111 0          0 (30)
11111           1 (31)
1 00000         0 (32)

So, after computing the Baum-Sweet sequence for n, take the numbers that were truthy for the sequence and collect them for the final result. For n=32 we would have:
[1, 3, 4, 7, 9, 12, 15, 16, 19, 25, 28, 31]

As the final answer.

This is code-golf, shortest byte count wins.

a) is printing essential, or can we just return a string or array? b) do the results have to be in ascending order?

@Erresen as long as the digits are displayed I am fine with whatever is golfiest in your language.

"For more information, click the link." No. Put it in the question.

05AB1E, 10 9 bytes
Saved a byte thanks to Adnan
ƒNb00¡SP–

Try it online!
Explanation
ƒ          # for N in [0 ... input]
 Nb        # convert N to binary
   00¡     # split at "00"
      S    # convert to list of digits
       P   # product of list
        –  # if 1, print N

Does ƒ work instead of >G?

@Adnan: Yes of course. I didn't use it to avoid N=0, but as it contains an odd number of zeroes it doesn't matter. Silly of me. Thanks :)

@Emigna was hoping to see .¡ used ;).

@carusocomputing: I considered that, but unfortunately I never got it shorter than this.

JavaScript (ES6), 70 68 63 bytes

g=n=>n?g(n-1).concat(/0/.test(n.toString(2).split`00`)?[]:n):[]

console.log(g(1000).join(", "))

Slightly more interesting recursive solution:
n=>[...Array(n+1).keys()].filter(f=n=>n<2?n:n%4?n&f(n>>1):f(n/4))

67 bytes thanks to @Neil.
g is the function to call.

That's an interesting approach, have you done this before?

@carusocomputing Not this particular sequence, but I've done this type of recursion several times in the past. f is similar to a function I use occasionally to count the number of 1-bits in a number.

Doesn't f fail when n=0? Also as f only returns 0 or 1 you can shave off two bytes by using n&f(n>>1).

@Neil "print the integers from 1 to n", n = 0 isn't a case ;).

I shaved a further byte off your recursive solution by switching to filter: n=>[...Array(n+1).keys()].filter(f=n=>n<2?n:n%4?n&f(n>>1):f(n/4))

@carusocomputing Ah, sorry, I thought g called f(0) at some point.

Bash, 58, 46 bytes
EDITS:

Replaced bc with dc (Thx @Digital Trauma !)
Start with 1;

Golfed
seq $1|sed 'h;s/.*/dc -e2o&p/e;s/00//g;/0/d;x'

Test
>./baum 32
1
3
4
7
9
12
15
16
19
25
28
31

Explained
shell
seq $1 #generate a sequence of integers from 1 to N, one per line
|sed   #process with sed

sed
h                #Save input line to the hold space
s/.*/dc -e2o&p/e #Convert input to binary, with dc
s/00//g          #Remove all successive pairs of 0-es
/0/d             #If there are still some zeroes left
                 #(i.e. there was at least one odd sequence of them)
                 #drop the line, proceed to the next one
x                #Otherwise, exchange the contents of the hold
                 #and pattern spaces and (implicitly) print

Try It Online !

Python 2, 62 bytes
g=lambda n:n*[0]and g(n-1)+[n]['0'in`bin(n)[1:].split('00')`:]

Checks for odd runs of 1's in the binary representation by splitting on 00 and checking if any zeroes remain in the string representation of the resulting list. Annoyingly, binary numbers start with 0b, which has a zero that needs to be removed to avoid a false positive.
The enumeration is done by recursing down.

Batch, 143 bytes
@for /l %%i in (1,1,%1)do @call:c %%i
@exit/b
:c
@set/ai=%1
:l
@if %i%==1 echo %1&exit/b
@set/ar=%i%%%4,i/=4-r%%2*2
@if %r% neq 2 goto l

Perl 6, 40 bytes
{grep {.base(2)!~~/10[00]*[1|$]/},1..$_}

Try it
{
  grep            # find all of them
  {
    .base(2)      # where the binary representation
    !~~           # does not match
    /
      10          # ｢10｣
      [ 00 ]*     # followed by an even number of ｢0｣s
      [ 1 | $ ]   # either at end or before a ｢1｣
    /
  }, 1 .. $_      # from one to the input
}

( [] are used for non-capturing grouping, with <[]> used for character classes )

PowerShell, 79 61 bytes
1..$args[0]|?{0-notin([convert]::ToString($_,2)-split'1|00')}

Try it online!
I had inspiration this morning to change how I perform the -split operation, then see that it's similar to how xnor's answer is constructed, so, I guess great minds think alike?
We loop from 1 up to input $args[0], and use a Where-Object operator to pull out the appropriate numbers |?{...}. The clause is a simple Boolean value -- we're ensuring that 0 is -notin the results of (...).
Inside the parens, we [convert]:: the current number $_ ToString with the base 2 (i.e., turn it into a binary string). We then -split the string on the regex 1|00 -- this is a greedy match, and results in an array of strings (for example, 100010 would turn into '','','0','','0' and so forth).
Thus, if every run of 0s in the binary string is even (meaning the regex has split them out into empty strings), then 0 will be -notin the result, so the Where clause is true, and the number is selected. Those numbers are left on the pipeline and output is implicit.

Python 2, 67 47 bytes
f=lambda n,k=1:n/k*[1]and[k]+f(n,k-~k)+f(n,4*k)

Thanks to @xnor to golfing off 20(!) bytes!
Returns an unordered list. It's quite efficient: input 100,000 takes roughly 40 ms on TIO.
Try it online!

Nice method! I think you can do the base case as [1][n:]or. Also, x-~x for 2*x+1.

This gives a very clean solution if you recurse out the tree instead: f=lambda n,k=1:n/k*[1]and[k]+f(n,k-~k)+f(n,4*k), assuming the ouputs can be in any order.

@xnor That's crazy short. Thanks!

Mathematica, 59 bytes
Select[Range@#,!Or@@OddQ/@Tr/@Split[1-#~IntegerDigits~2]&]&

Mathematica answer number 4...

MATL, 12 11 bytes
:"@BY'og)?@

Try it online!
Explanation
To detect if a number is valid this converts to binary, applies run-length encoding, keeps only runs of odd length, and checks if no run of zeros survives.
:       % Take input n implicitly. Push range [1 2 ... n]
"       % For each k in [1 2 ... n]
  @     %   Push k
  B     %   Convert to binary
  Y'    %   Run-length encoding. Pushes array of values and array of run-lengths
  o     %   Parity. Gives array that contains 0 for even lengths, 1 for odd
  g)    %   Convert to logical and use index into the array of values
  ?     %   If the result does not contain zeros
    @   %     Push k
        %   End
        % End
        % Implicitly display stack

Edited question for clarification, I figured some people would just click the OEIS and go from there without reading ;P. That's what I do sometimes too hah.

@carusocomputing Yes, I always read too fast :)

R, 75 bytes
for(i in 1:scan()){x=rle(miscFuncs::bin(i));if(!any(x$l%%2&!x$v))cat(i,"")}

Reads input from stdin and uses the bin function from the miscFuncs package to convert from decimal to binary vector. Consequently performs run-length encoding to check values == 0 and lengths are odd.

Stacked, 69 bytes
Try it here!
:>1+[bits{e.b:e b 0#=}chunkby[0 has]filter$sizemap 2%0 eq all]"filter

Or, noncompeting at 67 bytes:
:>1+[bits{e.b:e b 0#=}chunkby[0 has]filter$sizemap even all]"filter

And, even more noncompeting at 49 bytes:
:>1+[bits rle{k:k 0=}filter values even all]fkeep

All take input as TOS and leaves output on TOS.
Explanation
:>1+[...]"filter   input: n
:>                 range from [0, n)
  1+               range from [1, n]
    [...]          a function
         "filter   apply to each cell and filter

The function:
bits{e.b:e b 0#=}chunkby[0 has]filter$sizemap 2%0 eq all  input: c
bits                                                      convert c to binary
    {e.b:e b 0#=}chunkby                                  split into chunks of contiguous 0s
                        [0 has]filter                     take only chunks with 0s
                                     $sizemap             map each chunk to its size
                                              2%          vectorized modulus 2
                                                0 eq      vectorized equality with 0
                                                     all  all of them are of even lengths

Explanation of noncompeting:
It's the same as above, with a few key differences:
:>1+[bits rle{k:k 0=}filter values even all]fkeep   input: y
          rle                                       run length encode y
             {k:k 0=}filter                         keep keys that = 0
                            values                  get those values
                                            fkeep   like `filter`, but is implemented with
                                                    taking `f` as a boolean mask

Stacked looks like it could be fun to play with!

@ElPedro thanks :D it really is

Befunge, 84 51 49 bytes
After a bit of experimentation, I realised I could do quite a bit better than my original solution by using a technique similar to the Batch answer that Neil came up with.
<v::\<&1
:_v#:/+2*2!%2:_v#-2%4
:$<@_v#!:-1\+1$<:.

Try it online!
As with my original solution, there are two loops - the outer loop iterating over the numbers we want to test, and an inner loop testing the bit sequence for each number. The way the test works is by examining two bits at a time (modulo 4 of the current value). If that's equal to 2 we've got an odd sequence of zeros and can abort the inner loop and proceed to the next number.
If the modulo 4 is not equal to 2, we need to continue testing the remaining bits, so we shift up the bits that have already been tested. This is done by dividing the value, lets call it n, by 2+2*!(n%2). This means if the first bit was a 1, we divide by 2 (dropping that 1 bit), but if it was a 0, we divide by 4, so we'll always be dropping pairs of zeros.
If we eventually get down to zero, that means there weren't any odd sequences of zero bits, so we write out the number.

Java, 144 130 128 Bytes
This isn't as golfed as I think it can be, but I thought it'd be a cute solution to use a Regex, despite never having used one.
Golfed:
static String a(int n){String s="";for(Integer i=0;i++<n;)if(i.toString(i,2).replaceAll("00|1","").isEmpty())s+=i+" ";return s;}
Ungolfed:
static String a(int n){
    String s="";                      //Cheaper than using a list/array
    for(Integer i=0;i++<n;)           //Loop n times
        if(i.toString(i,2)            //Convert int to base 2 string
                .replaceAll("00|1","")//Find and remove ones and consecutive zeroes
                .isEmpty())           //If any chars remain, i is truthy
            s+=i+" ";                 //Append i to the storage string
    return s;                         //Return all values
}

Edit: I was able to save 14 bytes by making the regex 00|1 instead of 00, and removing ".replace("1","")" between the replaceAll and isEmpty!
Edit 2: I was able to save 2 bytes by making i an Integer and referencing Integer.toString with i.toString.

@JamesHolderness Thanks for catching that! I made the mistake of golfing and ungolfing it a few times when I was first writing it, so that must have been how it snuck through.

Visual Basic(.net 4.5) 163 bytes
First ever answer here so I'm sure I've screwed something up. Let me know and I'll fix. Are Visual Basic lambdas even allowed?
Thanks to MamaFunRoll for the remove consecutive zeroes idea
Dim R=Sub(m)System.Console.WriteLine(String.Join(",",System.Linq.Enumerable.Range(1, m).Where(Function(s) Not Convert.ToString(s,2).Replace("00","").Contains(0))))

R(32) outputs
1,3,4,7,9,12,15,16,19,25,28,31

Clojure, 103 bytes
I don't think this is the shortest way...
#(remove(fn[v]((set(map(fn[s](mod(count s)2))(re-seq #"0+"(Integer/toString v 2))))1))(range 1(inc %)))

Uses re-seq to find consecutive zeros, maps their modulo-2 lengths to a set, discards them if number 1 is found from the set.

C# 159 157 155 bytes
Saved 2 x two bytes thanks to TuukkaX.
Note: prints out the ints in reverse order.
void B(int n){var b=Convert.ToString(n,2);int c=0,i=0;for(;i<b.Length;){if(b[i++]<49)c++;else if(c%2>0)break;}if(c%2<1)Console.WriteLine(n);if(n>1)B(--n);}

Explanation:
void B(int n)
{
    // convert our int to a binary string
    var b = Convert.ToString(n, 2);

    // set our '0' counter 'c' and our indexer 'i'
    int c = 0, i = 0;

    // loop over the binary string, without initialisation and afterthought
    for (; i < b.Length;)
    {
        // check for '0' (48 ASCII) and increment i. increment c if true
        if (b[i++] < 49)
            c++;

        // otherwise check if c is odd, and break if it is
        else if (c%2 > 0)
            break;
    }

    // print the int if c is even
    if (c%2 < 1)
        Console.WriteLine(n);

    // recursively call B again with the next number
    if (n > 1)
        B(--n);
}

At a first glance, c%2==0 could be c%2<1.

Oh wait, this isn't even a valid submission. It should print the correct results from 1 to N.

@TuukkaX must've misread the question... revising answer now.

@TuukkaX Edited and credited

b[i++] == '0' could be b[i++]==48, but since the other possible character is '1' (ASCII 49), you can just check whether b[i++]<49.

Wonder, 38 bytes
@(!>@=1len iO0Rstr#["00"]bn#0)rng1+1#0

Usage:
(@(!>@=1len iO0Rstr#["00"]bn#0)rng1+1#0) 32

Explanation
More readable:
@(
  fltr@
    = 1
      len
        iO 0
          Rstr #["00"]
            bn #0
) rng 1 +1 #0

rng 1 +1 #0: Range from 1 to input.
fltr@ ...: Filter range with the following predicate.
bn #0: Convert current item to binary. (This will have a leading 0b).
Rstr #["00"]: Recursively prune any occurrences of 00 in the string.
len iO 0: Count the amounts of 0s in the string.
=1: Check if the amount is equal to 1. If the only 0 left in the string after pruning is in the leading 0b, then this returns true; otherwise, this returns false.

Ruby, 78 69 68 bytes
->n{(1..n).select{|m|m.to_s(s=2).split(?1).map{|i|s|=i.size};s&1<1}}

Older versions:
->n{(1..n).select{|m|m.to_s(2).split(?1).select{|i|i.size%2>0}[0].!}}
->n{(1..n).select{|m|b=z=0;(m.to_s(2)+?1).each_char{|i|z+=i>?0?b|=z:1};b&1<1}}

Python 3, 86 82 bytes
Golfing in progress...
lambda n:[x for x in range(1,n+1)if 1-any(i%2for i in map(len,bin(x).split('1')))]

Golfed off 4 bytes by changing bin(x)[2:] to just bin(x) - this leaves 0b at the start of the string, but I realised this does not actually affect the calculations :)

Mathematica, 81 bytes
Select[Range@#,FreeQ[Union@#+Mod[Length@#,2,1]&/@Split[#~IntegerDigits~2],{1}]&]&

Computes, for each run of consecutive digits in a number, { the common digit in that run plus (1 if the length is odd, 2 if the length is even) }; if any of the answers is {1} then the number isn't in the sequence.

Mathematica, 75 bytes
Select[Range@#,And@@EvenQ/@Length/@Cases[Split[#~IntegerDigits~2],{0..}]&]&

#~IntegerDigits~2 computes the list of binary digits of the input #. Split that list into runs of identical elements, take the Cases that match {0..}, take the Length of each of them, take EvenQ of the lengths and then return And of the results.

One byte saving you can take from my solution: !Or@@OddQ/@...

Python, 142 bytes
This is mainly just to practice golfing my Python.
def o(n):
 r=0
 for i in bin(n)[2:]:
  if i=='1':
   if r&1:return 0
   r=0
  else:r+=1
 return ~r&1
lambda n:[i for i in range(1,n+1)if o(i)]

Jelly, 15 13 10 bytes
saved two bytes after looking at other answers, another 3 bytes thanks to Dennis
Bœṣ0,0Ȧµ€T

Explanation
Bœṣ0,0Ȧµ€T -Helper link: argument K (integer): ex. 24
B          -Convert K to a list of its binary digits: 24 -> [1,1,0,0,0]
   0,0     -Create a list of two 0's: [0,0]
 œṣ        -Split the binary digits on instances of the sublist: [1,1,0,0,0]-> [[1,1],[0]]
      Ȧ    -Any and All: Check if our list has any falsy values or is empty
       µ   -Take all our previous atoms and wrap them into one monad.
        €  -Map this new monad over a list. Since our input is an integer, this implicitly maps it over the range [1..N] (Like the 'R' atom)
         T -Get the indices of all truthy values (1's)

https://tio.run/nexus/jelly#ARcA6P//QsWT4bmjMCwwyKbCteKCrFT///8zMg saves 3 bytes.

Jelly, 10 bytes
2ṗx"`ḂḄf@R

Terribly inefficient. Try it online!

Ruby, 54 53 48 bytes
->n{(1..n).reject{|x|x.to_s(2)=~/10(00)*(1|$)/}}

I didn't think the regex for this was going to be quite so basic.
edit 1: switched to reject to get rid of negation for -1.
edit 2: switched match to =~ for -5.

Mathematica, 69 bytes
Select[Range@#,FreeQ[#~IntegerDigits~2//.{x___,0,0,y___}:>{x,y},0]&]&

The same length:
Select[Range@#,#~IntegerString~2~StringDelete~"00"~StringFreeQ~"0"&]&

Ruby, 53 Bytes
->n{(1..n).each{|n|p n if n.to_s(2).count(?0).even?}}


text:
Positional Awareness
Positional Awareness
Your task is to generate a program that, for every permutation of its characters (which includes the original program), outputs the positions of every character relative to the original program.
If your program is
Derp

you must output
[0, 1, 2, 3]

(or some equivalent). This is because D is in the 0th position, e is in the 1st, r the 2nd, and p the 3rd.
Let's take another program which is the original program, but with its characters permuted:
epDr

You must output
[1, 3, 0, 2]

because e is in the 1st position of the original program, p is in the 3rd position, D the 0th, and r the 2nd.
If the original program has two repeating characters:
abcda -> [0, 1, 2, 3, 4]

Then for the permutation, the 0 and the 4 in the array must be in ascending order:
baadc -> [1, 0, 4, 3, 2] (0 first, then 4)

Rules:

Your program must contain at least two unique characters.
At most floor(n/2) characters are to be the same.
 aabb (acceptable)
 aaaabc (not acceptable, only floor(6/2) = 3 a's allowed)

Your program's output can be either an array (or something similar) containing all the characters' positions in order, or a string with any delimiter, so these are perfectly fine:
[0, 1, 2, 3]
0,1,2,3
0 1 2 3

I don't believe this challenge allows for any non-trivial solution as virtually any answer in any language of length >= ~5 will not be a valid program for every permutation, let alone a program that solves the challenge at hand.

@orlp What if I reduce it to one permutation? This didn't come up in the sandbox at all, so I didn't realise the problem. I expected this challenge would be like the "Hyperprogramming" one (which was possible), but I guess I'm wrong.

@Qwerp-Derp Almost nobody says anything on the sandbox. A while ago, I've posted a question after being in the sandbox for around a month (or so). And only when I've posted it, was when people pointed out mistakes and the downvotes rained. In my honest opinion, the sandbox is useless.

For once, I feel like in this challenge, a longer answer would be more impressive than a shorter one.

@Wojowu I can make it [tag:code-bowling], if that's possible - the longest program wins.

Would the program 12 in R be valid? It would simply print 12 and if permuted; 21.

@JamesHolderness I think this might warrant a new question, perhaps with a different criterion than this one. I'll come up with something.

Actually, 2 bytes
10

Try it online!
This prints
0
1

while the (only) other permutation
01

prints
1
0

How it works
In Actually, consecutive digits are parsed separately, so 10 pushes 1 on the stack, then 0 on top of it.
When the program finishes, the stack is printed top to bottom, so it prints 0 first, then a linefeed, then 1.
The derranged program 01 does the same, in the opposite order.

Other languages this works in; Seriously, 05ab1e, ///, 2sable.

The spec says the numbers have to be separated. It does work in Seriously, but Actually is actually just Seriously 2.0.

Jelly, 2 bytes
;J

Try it online!
Outputs: [0, 1]
Other permutation J; outputs: [1, 0]
How it works:
;J
;          Concats 0 with...
 J         [1...len(z)], here just [1]

J;
J          [1...len(z)], here just [1]
 ;         ...Concatted with 0

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
We Are Number One, but …
Task
Your task is to write a program that will take input, and then output the lyrics to We Are Number One, changing specific words. The input will contain both the words to be changed, and the replacement word.
Input
The input will be in the following format:
one, two\n
net, villain\n

(\n is a newline, it's not actually visible.) The input is assured to be this format, and the first word will always be a word the lyrics contains. But you can take input in whatever format you prefer the most.
Output
Your output will be the entire We Are Number One lyrics, but with the words that are given in the input swapped.
Original lyrics:Hey!
We are Number One
Hey!
We are Number One
Now listen closely
Here's a little lesson in trickery
This is going down in history
If you wanna be a Villain Number One
You have to chase a superhero on the run
Just follow my moves, and sneak around
Be careful not to make a sound
(Shh)
(CRUNCH)
(No, don't touch that!)
We are Number One
Hey!
We are Number One
We are Number One
Ha ha ha
Now look at this net, that I just found
When I say go, be ready to throw
Go!
(Throw it on him, not me!)
(Ugh, let's try something else)
Now watch and learn, here's the deal
He'll slip and slide on this banana peel!
(Ha ha ha, gasp! what are you doing!?)
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number One
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number One
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number One
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number One
Hey!
Hey!Source
Rules

The first word per input is assured to be in the lyrics.
Your code must be case-insensitve (one as input will replace One)
Trailing newlines are allowed.
The input may be lower and uppercase, and the resulting output must have the same casing as the provided input.
The input can try to replace e.g. one with one. If you replace it or not, is your choice.
"Words" are sequences of characters seperated by space or commas, not by anything else (e.g. Hyphens), therefore Ba is not a valid input, but Ba-ba-biddly-ba-ba-ba-ba is.

Example case
Input:
one, three
net, villain

Output:Hey!
We are Number three
Hey!
We are Number three
Now listen closely
Here's a little lesson in trickery
This is going down in history
If you wanna be a Villain Number three
You have to chase a superhero on the run
Just follow my moves, and sneak around
Be careful not to make a sound
(Shh)
(CRUNCH)
(No, don't touch that!)
We are Number three
Hey!
We are Number three
We are Number three
Ha ha ha
Now look at this villain, that I just found
When I say go, be ready to throw
Go!
(Throw it on him, not me!)
(Ugh, let's try something else)
Now watch and learn, here's the deal
He'll slip and slide on this banana peel!
(Ha ha ha, gasp! what are you doing!?)
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Hey!
Winner
This is code-golf, so the author of the shortest code in bytes wins!

Related

Gotta love memes, do I get a bonus if I output a noise for the branch scene? ;)

also related - looks like all the memes are coming to PPCG!

Is there a reasonable way to do this other than producing the lyrics kolmogorov-complexity-style, then using your language's string replacement methods on the results? This seems like the concatenation of two separate challenges.

Does "here's" need to be handled as a word? Is "Ba-ba-biddly-ba-ba-ba-ba" a word, or is each part a word? Can a word be replaced by another word that is itself a word to be replaced, and if so, do the replacements happen in sequence? Should the replacements preserve the capitalization of the original? Are the input words guaranteed to be lowercase? Are you guaranteed the song contains both words?

@xnor I believe all your questions should have been answered in the rules and retags now.

Isn't this a dupe of the pineapple one?

The pineapple one has a given pattern, this allows the input user to choose any word, not by pattern @EasterlyIrk

@devRicher hm, it's the same other than the forced capitals in some spots and the any-word-can-be-replaced.

@EasterlyIrk "It's the same except the task of the challenge is something else"

@devRicher nah, the KG but replacing words is the same (which is the main part of the challenge, just the little bits are different)

"Your code must be case-insensitve" is not good wording.

I see this question has very mixed opinions on it (half votes, half downvotes). Is there anything unclear with it?

In at least 2 answers below, the input was restricted to exactly two word, word pairs. The question doesn't seem to be clear on the range of the input. Should programs be able to handle an arbitrary amound of word, word\n pairs?

replace substrings or whole words only?

There has been a meta post regarding these sorts of questions: http://meta.codegolf.stackexchange.com/questions/11011/do-we-need-the-lyrics-tag. You can read it to see it our opinion

PHP, 661 652 bytes
for($s=base64_decode(gzuncompress("eJy1ks1u2zAQhO98itXJNqA8Q4DkULsHF2jzgx7X4tpkvSINkorAt+9QaoECyaE9VNoDQa44M99qL7Uzr0KchI7TeJJEX4KY/cfbeI5xJvW5SKBBYxataE6yycTYL0WFVHKOgXygkvxwlVTNk/OZUJfow4VsnJdjbJaI08OZapxo5hCYTlClF6/K6PhD+zs6HL8JlUiD49za8nST5CRFgl5xQmkK5vOUC52jKpyOlcb4JrknDpZyEL4iU5yCNQ9CA+KdJ6UQS7t15Oty6XK8/ebczmwfvz4fH/dYHGMP32HTOqfBQY1LtwOQv4b3Ec49IxNqxRoj3EGgwQpS+kWEDvRjTdRsvTqAP1DmCpZ9g5WEbW32i0txNp9iZ7ZPbUm+NCzOj/2ScBT43T5fXI8JFQyspIqwo0APQxHNslt8zFwQsAFT4RR6cuuAG2ArrAi4UaWs/rZiVW9lnQCMnzjgpZuIwsnvgD1dON86mluihqEN3La/obtvFB/47oTy1mpdVr8KEfnuXZnuXz94D/9/K3bLf/AT6bEYSw"));$t=fgetcsv(STDIN);)$s=preg_replace("#\b$t[0]\b#i",$t[1],$s);echo$s;

gzinflate is 3 bytes shorter than gzuncompress, but gzcompress has the shorter output.
And: The other PHP answer replaces substrings, not words. I´d save 8 more bytes with that.
breakdown
for($s="text";                              // init text
    $t=fgetcsv(STDIN);)                     // loop through STDIN lines
    $s=preg_replace("#\b$t[0]\b#i",$t[1],$s);   // replace pairs
echo$s;                                     // output

PHP, 666 bytes
I suppose this is a rather appropriate code size for a song about Villains...
<?$s=gzinflate(base64_decode("zVLNitswEL4b/A6TUxLwPkNh99BkDynsT5ceJ9YkUjPWBEle47fvjJVCoWyh0EPRYMme8cz3ox3Nq7Z5I8BEcBiHIyX4Eqltdh8l6jrIBBxyoQg9Syae7ZdE6wyoiVKYgClniRAilBT6CyWtefEhg8ZZQjyDk2nJ68cilt6fYJYRJowR4ajD4WtgRi35FcI3LfH4TlAEeo/Z6vJ4peQpCejI4gnSGNvmccwFTsKscIcZBnmn3AFGBzkSXpScjNG1zT1Br0RPI0OUYn0HvCxta37z7P1Wt4en18PDzk4H6RR+XFvx2HsdiWW1reL8jZwfKLxDZahxU1pEseooUy9S6ZZxsIfvld+C8c2rGXvIOKu6namXCN1sZIpPMrXNZ1EMmxd7gVBMKB+GbmE8kIHfvJ59p74VtbGkWdkPpDPVKeJM2wpmwqJ8TUMmTLEDX3030R0hG9k1M2QO1yo1B0fVFoV/xKgLrkRsaH4S7eCM+bqCyYiZInYPnN2S1aebrPd4d9QIzvG8nG6hXPHut/iDDf+g0f+EpTay5w8="));foreach($argv as$a){@list($a,$b)=explode(",",$a);$s=str_ireplace($a,$b,$s);}echo $s;

Usage: php numberOne.php one,three net,villain

upvote for the combination of villains + 666 + php

http://php.net/manual/en/function.bzcompress.php should save some bytes and replace echo $s; with echo$s;

Python 2.6, 695 bytes
import re
import zlib,base64

a=input().split(', ')
t = zlib.decompress(base64.b64decode(b'eJzNks+KGzEMxu9+Cs0pCcw+w8LuoUkPKbT7hx6VsRK70VjB9uzgt68000KhWyj0UiKCsYW+7/tp9tQ690qAmeA4jSfK8CmR279/7dxRZuBYKiUYWApx095MmwKo97UyAVMpkiAmqDkOV8rNPYVYQOsiMV3Ay7w862UVfT2cockEM6aEcFJReInMqB2/SH/VjoBvBFVgCFisrUw3yoGygOrVQJCn5D5OpcJZmNXp2GCUNyo9YPJQEuFVI8mUvHsgGDTdeWJIUm3qiNdl6PK8/RLCzm0fPz8fH/d6OEqvvtPGOqchqBrWbqdA/prdezT3qJm0Vqwi6k4FDFai2i8icIBvayKz9RoU/AEKNmXZG6xM6JvZryHL7D5I57ZPdoRYDUuIY78kHEn9bp8vodcNVV1YzU3DjqR6uhTiQrvFx4xVAxowJsyph7Au2AB7QtaAG2YoHG8rVo6e1g2o8RMm/cGNiNXJz4A9XLDcOpgtkWGwhXv7Grp7o/iAdyet6D235fSjNCLe/VZ/gv7PU/4TG8sU+/sO/HItbg==')).decode('utf8')
for i in xrange(0,len(a),2):
    t = t.replace(a[i],a[i+1])
print t

Output
Hey!
    We are Number three
    Hey!
    We are Number three
Now listen closely
Here's a little lesson in trickery
This is going down in history
If you wanna be a Villain Number three
You have to chase a superhero on the run
Just follow my moves, and sneak around
Be careful not to make a sound
(Shh)
(CRUNCH)
(No, don't touch that!)

We are Number three
Hey!
We are Number three
We are Number three

Ha ha ha
Now look at this villian, that I just found
When I say go, be ready to throw
Go!
(Throw it on him, not me!)
(Ugh, let's try something else)
Now watch and learn, here's the deal
He'll slip and slide on this banana peel!
(Ha ha ha, gasp! what are you doing!?)

Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Ba-ba-biddly-ba-ba-ba-ba, ba-ba-ba-ba-ba-ba-ba
We are Number three
Hey!
Hey!

The word-to-replace, word arguments should be dynamic. At the moment, you hardcoded it to have exactly 2 arguments with the to-be-replaced words always being One and net. Also, there's a lot of golfing potential there. You can disregard input entirely and take the string as a function argument, write everything in one line, compress the text (substitution, zlib come to mind), use shorter variable names, replace re.I and re.X with their numerical values. Additionally, this doesn't even run as word1 and word2 aren't defined (you probably meant w1 and w2.

edited my code...

Python 3.4, 666 bytes
import zlib,base64,sys,re;s=zlib.decompress(base64.b85decode(b'c%03W&uSwv494$%3e71AOrN399-8!!!fyYtM`f(UZZuY~Jste^D|@=Iuw5whQX+z}g}(3mX|_~4^Fn};U_XrqitrG~Y(Ks>W-l|aPniM?EQz>iZ=_WM)cc&7fGH&j-~;67hcm@u9-U91brK&=U}bL4dYMIEcSk5P!Hgjw98?sZJu_;@U(&y{!{Hl278o3++LopZMMqIU^|B*~Q!w{a%5W5BbvhOp<&9Dg7%Zefc-BZV1#4~y22FRI7=q+Fb;NTU+Md@xo!gl8?T@GZ?N$$a>D6~w)y`>fs)o7SD3H&?`v|AmqNdVXz>26pm8iG^<-W<l4qlf`)!2(u^gBpclxAOXMM7I@fb62o=1w}Zeym6Exq@+i>|4f>)baZ1<a*sv)|KU0H10^Mr)wcjv}rzO%o?#GW5O7EaLbA-VoS)HaK#LX{bd2m-qNxIHGaULKe!OFI{6c@hZCkt2XjqSIn<Tg`aN{ljpGeo9kjf)T-xcqG$UU9Q~$&M<tg99Mw?RqegpM6EsO')).decode('utf8');
for a in sys.argv[1:]:x,y=a.split(', ');s=re.sub(x,y,s,99,2);
print(s)

Edits:

Used regex replace instead of replace so that it works case insensitive.
Used command line to get the parameters instead of input.

Your solution appears to accept only two text pairs. Also, you have to split at , , not just ,. You can golf this down by converting it into a function import zlib,base64 def h(a,b):return "string".decode('utf8').replace(*a.split(", ")).replace(*b.split(", ")). Note that this will be still incorrect as the number of args is limited to 2. It also seems that you have compressed the wrong lyrics; when I decompressed your string I got the version with We are Number three, which is an example output in the question above.

Changed it to the correct text & split at ', ', question didn't mention that there could be more than 2 inputs. Also noted that it's case sensitive so some rework to be done it seems.

05AB1E, 842 bytes
•®_Ç²îü!úïæ²|ˆ9¶iˆtˆEC}#©ÿ®cÖ:|®¥÷K*œÒÅ5œ1‚ÂlÊÎ¤Nç·’±Ðá×ÍÐý5WÝã¢®ìÖ$hVbPGwÎ·M;9O|‰¶ÉèëøËöç¡QÒµ5‚aC}.*gbJÇ¦>);&f€ZÛ}íóÉh\„Ú;Ts§ÞT¿QZëDò©®#ÑSHžûd¦Óéó”ó\ê§ø5|PšÍÖcyÐÁ:hŒ02¨ÄùSûíi¯—àR›ÿR{3Í)Ú×E<u¥°¼:—jth€ƒWÆªâþ=—vJ†ÀJûy6Áv\TÈÞåšöQë£Âb„ˆ@Ò6^#ˆL*ÁöªAWçàˆÌä£#«ùÁ°è;sq¯¸GšìááÐ©–ob¾§m^¹+ò"-Å£‘u·ãÿ?ù÷7Á^)8GÑ<oßÝ7Åjœq–[—'XuDÔÈìïÃ÷áÓ´‚ñ)©™à$ÝS¢¦(ð8M'§›¬§³N(En"H#«Ÿß½µ`Å´½axxq\òÝP@HÓ‘š£m—‹váøÃGàhT™ËUc·€ô~¥CEw6G¥Âã”ú¾&º™e,"AÂy±²ÅÜÚMâ2qtBaaª.^`òÍ–Ú$¦~z¢PÇR²”6â#”½Ì0ÂVêž]oÉ¦s¯Ž½Ç˜ûRG™¸§I?™µ¦½ÀÓþæ8i‚%‘L#]ÒXÓ†A“r*Å;E%c¾0H;ø<½yÎ=^ù_í<ÃòõŽŸq!ùßN÷wP0q1¹‰~Õ¿´zÿgI,¸$ž¬…ÃÊGÖ¢e¸ŒHFMcw,Î()¼ü»T×–r{&h·q²¬5¡ýWÑÈú¬«ñÚRóD›<üŽ‹Nê*¹f¦›þÆYÓ–hýÂ}§l<Ñò<Ýù†ïÓi#‹k€ö#[ûlù_=¡ç·FÜØ]¢n©l›ÜÍ,ÉˆØrôN5Ô¸¹NGúoÝ][{½ãÚ;S*ÌåÙC€\À=k½;qU,pT$Ÿ5uÕœ¼§/›Kàô™eéù‚.Úæ·vx¾Xugvš–ûî?øc}|/žr¡¶µt…’öà,2;ˆ«=ÆF5£ØÓ¯~À|ýÝÓß]nLÔ<ëïÂåkQ`µ3DxÐ‘!´‚Ù7AÏmi¦nvgã…ñ•121B"012345678"¶" ()!,-'?"«‡¹',¡vyN²',¡è.:}

Try it online!
Simplistic approach, didn't do anything but replace symbols with integers, convert from base-121 to base-214. Then I decompress it, re-replace the characters and perform replacement on the words. For testing I suggest replacing pronouns with other pronouns.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Validate Random Die Tippers
Almost six years ago, fellow PPCG member steenslag posted the following challenge:

In a standard dice (die) the numbers are arranged so that opposite
  faces add to seven. Write the shortest possible program in your
  preferred language which outputs a random throw followed by 9 random
  tippings. A tipping is a quarter turn of the dice, e.g. if the dice is
  facing 5, all possible tippings are 1,3,4 and 6.
Example of desired output:

1532131356

So, now that everybody has completely forgotten about it and the winning answer has long since been accepted, we'll be writing a program to validate the die tipping sequences generated by the submitted solutions. (This makes sense. Just pretend it does.)
Challenge
Your program or function  is given a sequence such as 1532131356. Validate that each consecutive digit is:

Not equal to the previous digit
Not equal to 7 minus the previous digit

(You don't have to validate the first digit.)
Rules

Your program must return a truthy value if the input is valid and a falsey value otherwise.
You can assume that the input consists of only the digits 1-6 and is at least 1 character long. Sequences won't have a fixed length like in steenslag's challenge.
You can take the input as a string ("324324"), an array or array-like datastructure ([1,3,5]) or as multiple arguments (yourFunction(1,2,4)).

Standard I/O and loophole rules apply.
Test cases
Truthy
1353531414
3132124215
4142124136
46
4264626313135414154
6
2642156451212623232354621262412315654626212421451351563264123656353126413154124151545145146535351323
5414142

Falsey

Repeated digit
11
3132124225
6423126354214136312144245354241324231415135454535141512135141323542451231236354513265426114231536245
553141454631
14265411

Opposing side of die
16
42123523545426464236231321
61362462636351
62362462636361

Python 2, 43 45 bytes
lambda s:reduce(lambda p,n:n*(7-p!=n!=p>0),s)

43 bytes (inspired heavily by @Zgarb)
lambda s:reduce(lambda p,n:n*(p>0<n^p<7),s)

This function combines my reduce statement with the bit-flicking logic from @Zgarb's answer, for a combination that is shorter than both.
Both answers output the following:

0 if the input is not a valid sequence
The last digit of the sequence if it is valid

Welcome to PPCG,  This is a really nice first answer.

This doesn't work for about half of the false cases.  E.g. 3132124225 returns 5.

You can fix it using n and p*(7-p!=n!=p).

@JakeCobb It should work with all the test cases now. Unfortunately it's now 2 bytes longer :(

What a clever use of reduce, passing each value to the next step.

Python, 44 bytes
lambda x:all(0<a^b<7for a,b in zip(x,x[1:]))

Bitwise magic!
This is an anonymous function that takes a list of integers, and checks that the XOR of every two consecutive elements is between 1 and 6 inclusive.
Why it works
First, the XOR is always between 0 and 7 inclusive, since 7 is 111 in base 2, and our numbers have at most 3 binary digits.
For the equality, a^b == 0 if and only if a == b.
Also, we have 7-a == 7^a when 0 ≤ a ≤ 7, and thus a^b == 7 if and only if a == 7^b == 7-b.

05AB1E, 11 9 bytes
-2 bytes for Osable's smart idea of using a product.
¥¹D7-Á+«P

Try it online!
¥           # Push deltas.
 ¹D7-Á      # Push original array, and 7 - [Array] shifted right once.
      +     # Add original to the 7 - [Array] shifted right.
       «    # Concat both.
        P   # Product, if either contain a zero, results in 0, meaning false.

Third approach using 05AB1E, that doesn't use the pairwise command:

0 if it violates the tipsy properties.
Not 0 if there was nothing preventing it from being tipsy.

@Emigna didn't think it mattered but fixed!

I wanted to post an answer with deltas, but I did not think about Á. Nice!

You can save 2 bytes using the definition of truthy/falsy values with ¥¹D7-Á+«P . It yields 0 when there is a 0 in the array or any other value otherwise.

@Osable SMAART! Mega smart man, good job.

R, 39 37 32 31 bytes
all(q<-diff(x<-scan()),2*x+q-7)

Try it online!
Takes input from stdin. Uses diff to see if any two consecutive digits are the same; then compares each digit to 7 minus the previous digit. Returns TRUE or FALSE.
Saved 5 bytes thanks to Jarko Dubbeldam, and another thanks to JayCe.

Saving the differences in some variable q and then testing 2*x+q-7 instead of c(0,x)!=c(7-x,0) saves a few bytes. If x1 + x2 = 7 then 2*x1 + diff(x1,x2) = 7. Checking 2*x+q - 7 then explicitly tests !=0.

@JarkoDubbeldam Great observation, thanks! I've updated the solution.

save 1 byte

@JayCe Thanks, I've updated the answer now.

05AB1E, 10 bytes
$ü+7Ê¹üÊ*P

Uses the CP-1252 encoding. Try it online!

Argh!, why didn't I think of Ê :P Nice!

Hmm, so 1*[] = [] but product(1, []) = 1. That's good to know.

@Emigna Actually, that is a bug. The product of [] should be 1.

Yeah, I've wished that it worked like that several times before. Order of operations also matter here. )1*, )1s* and )1P are all [] while )1sP is 1.

@Emigna Ahh, that's because the product of [] gives an error and is discarded. That's why it gives 1. I'll try to fix it when I get home.

R, 49 44 bytes
!any(rle(x<-scan())$l-1,ts(x)==7-lag(ts(x)))

Reads input from stdin (separated by space) and outputs TRUE/FALSE. Will give a warning if input is of length one but still works.
Edit: saved a couple of bytes thanks to @rturnbull

You can combine all(x)&all(y) into all(x,y) to save some bytes. You can also switch rle(x)$l==1 to rle(x)$l-1, which will then return a set of all FALSE if x is valid; then switch the later != to an == and the all to !any. This yields !any(rle(x<-scan())$l-1,ts(x)==7-lag(ts(x))), saving 5 bytes in total. (PS, I've written an alternative solution you may be interested in.)

Ruby, 34 bytes
->s{!s[/[16]{2}|[25]{2}|[34]{2}/]}

you could shave off two bytes by using the string #[] method instead:
->s{!s[/[16]{2}|[25]{2}|[34]{2}/]}

I didn't know you can use it with regex, thanks.

05AB1E, 15 bytes
ü+7å¹ü-0å¹g_~~_

Try it online! or as a Test suite

JavaScript (ES6), 43 40 bytes
Returns 0 / true.
f=([k,...a],n=0)=>!k||k-n&&7-k-n&&f(a,k)

Test cases

f=([k,...a],n=0)=>!k||k-n&&7-k-n&&f(a,k)

console.log('Testing truthy cases ...');
console.log(f('1353531414'));
console.log(f('3132124215'));
console.log(f('4142124136'));
console.log(f('46'));
console.log(f('4264626313135414154'));
console.log(f('6'));
console.log(f('2642156451212623232354621262412315654626212421451351563264123656353126413154124151545145146535351323'));
console.log(f('5414142'));

console.log('Testing falsy cases ...');
console.log(f('11'));
console.log(f('3132124225'));
console.log(f('6423126354214136312144245354241324231415135454535141512135141323542451231236354513265426114231536245'));
console.log(f('553141454631'));
console.log(f('14265411'));
console.log(f('16'));
console.log(f('42123523545426464236231321'));
console.log(f('61362462636351'));
console.log(f('62362462636361'));

Sadly the simple port of the Retina answer is only 38 bytes.

@Neil I think it's actually 37 with test()

Sorry, I accidentally pasted a newline into the byte counter.

Perl 6, 22 bytes
Using a regex:
{!/(.)<{"$0|"~7-$0}>/}

Takes the input as a string. Inspired by G B's Ruby answer.
How it works:

/  /: A regex.
(.): Match any character, and capture it as $0.
<{  }>: Dynamically generate a sub-regex to be matched at that position.
"$0|" ~ (7 - $0): The sub-regex we generate is one that matches only the previous digit, or 7 minus the previous digit (e.g. 5|2).
Thus the overall regex will match iff it finds an invalid consecutive pair of digits anywhere.
{!  }: Coerce to a boolean (causing the regex to be matched against $_), negate it, and turn the whole thing into a lambda (with implicit parameter $_).

Perl 6, 38 bytes
Using list processing:
{all ([!=] 7-.[1],|$_ for .[1..*]Z$_)}

Takes the input as an array of integers.
How it works:

.[1..*] Z $_: Zip the input list with an offset-by-one version of itself, to generate a list of 2-tuples of consecutive digits.
[!=] 7 - .[1], |$_: For each of those, check if (7 - b) != a != b.
all (  ): Return a truthy or falsy value depending on whether all loop iterations returned True.

JavaScript 61 43 bytes
Comments have mentioned I can't use C# linq functions without including the using statement, so here's the exact same in less bytes using standard JS...
f=a=>a.reduce((i,j)=>i>6|i==j|i+j==7?9:j)<7

C#, 99 67 65 bytes
Takes input as an int array a
// new solution using linq
bool A(int[]a){return a.Aggregate((i,j)=>i>6|i==j|i+j==7?9:j)<7;}

// old solution using for loop
bool A(int[]a){for(int i=1;i<a.Length;)if(a[i]==a[i-1]|a[i-1]+a[i++]==7)return false;return true;}

Explanation:
// method that returns a boolean taking an integer array as a parameter
bool A(int[] a)
{
    // aggregate loops over a collection,
    // returning the output of the lambda
    // as the first argument of the next iteration
    return a.Aggregate((i, j) => i > 6 // if the first arg (i) > than 6
    | i == j      // or i and j match
    | i + j == 7  // or i + j = 7
    ? 9   // return 9 as the output (and therefore the next i value)
    : j   // otherwise return j as the output (and therefore the next i value)
    )
    // if the output is ever set to 9 then it will be carried through to the end
    < 7; // return the output is less than 7 (not 9)
}

I think this needs to be wrapped in a function, or maybe a lambda (does C# have those?) Also, you could save a few bytes by returning 0 or 1 instead of false or true

oh, ok - first post on code golf. I'll edit...

No problem. BTW, welcome to the site! :)

@DJMcMayhem Correct me if I'm wrong but since the output requirement is truthy/falsey then the output options are language dependent tl;dr 1/0 are not truthy/falsey in c#

@Phaeze You're correct that they're not truthy/falsey, but the standard IO rules http://meta.codegolf.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods reckon you can output using exit codes and that functions can output in the same way as programs. I'll change back to booleans if required, but it'll cost me a few bites

Fair enough, i just wan't sure how that rule applied to c# since it's kind of the black sheep for that :), either way though very nice answer

@Phaeze Cheers - I'm working on a lambda solution now, but if it comes to nought i'll switch to booleans. If i'm gonna play, i might as well play by the rules :)

Nice good luck. I'm working on a linq solution, trying really hard to get sub 90 ;)

When using linq functions your submission has to also include the using statement

You can save two bytes by replacing "==9" and "!=9" with ">6" and "<9", which serve the same purpose:
bool A(int[]a){return a.Aggregate((i,j)=>i>6|i==j|i+j==7?9:j)<9;}

@BenceJoful thanks! edited

@Phaeze really? that sucks. where's that written?

I'll try to find a post on it, I picked it up just from reading through challenges over the years. but to give an example as to why, in c# 6 you can import a static so you could assume that import and only call Sqrt() instead of Math.Sqrt()

Here is a general answer http://meta.codegolf.stackexchange.com/questions/383/should-imports-includes-count-in-golf   it mentions that the std import can be exlcuded which holds true for c# the compiler will automatically add that one.

And heres a better one that links to the different scenarios that have been asked. http://meta.codegolf.stackexchange.com/a/10848/19547

@Phaeze fair enough. I've switch the implementation to javascript's reduce function, and saved a few bites.

Python, 38 bytes
f=lambda h,*t:t==()or 7>h^t[0]>0<f(*t)

A recursive function that takes arguments like f(1,2,3).
This makes use of argument unpacking to extract the first number into h and the rest into the tuple t. If t is empty, output True. Otherwise, use Zgarb's bit trick to check that the first two die rolls are not incompatible. Then, check that the result also holds on the recursive call on the tail.

Processing, 93 92 90 bytes
Changed || to | : 1 byte saved thanks to @ClaytonRamsey
Started counting backwards: 2 bytes saved thanks to @IsmaelMiguel
int b(int[]s){for(int i=s.length;--i>0;)if(s[i-1]==s[i]|s[i-1]==7-s[i])return 0;return 1;}

Takes input as an array of ints, output 1 for true or 0 for false.
Ungolfed
int Q104044(int[]s){
  for(int i=s.length;--i>0;)
    if(s[i-1]==s[i]|s[i-1]==7-s[i])
      return 0;
  return 1;
}

Usually Java allows | instead of || if you want to save a byte.

@ClaytonRamsey I don't know why I didn't think of it, thanks!

I found another one. You could cut down on the use of returns with the tertiary operator

@ClaytonRamsey The return 0 is inside the if-statement while return 1 is not. I don't see how that is possible unless you have some other idea

never mind, I misread your code

But I'm glad that someone is trying to help me golf this verbosity :)

Why don't you loop the array backwards? That should save 1-2 bytes. Something like for(int i=s.length-1;--i;). I'm not sure if this works.

@IsmaelMiguel Thank you, this saves me 2 bytes!

Wow, I really wasn't expecting it to work! I know barely anything about Java and Processing.

Golfed it! Yipee! (nobody's going to read these summaries so why not have fun :) <-- I read it, while comparing what you have with what you had.

><> (Fish) 47 bytes
0:i:1+?!v\!
   0n;n1< >
!?-{:-"0"/^
!? -{-$7:/^

Pretty simple;
Line 1: check to see if inputted a number, if no number (EOF) then we have a truthy to print else checks.
Line 2: print outcome.
Line 3: turn input into number (ASCII 0 - from input), then check if it's equal to previous input.
Line 4: check if input is opposite side of die.

PowerShell, 57 44 41 bytes
(Crossed out 44 is still regular 44)
0-notin($args|%{7-$_-$l-and$l-ne($l=$_)})

Try it online!
(OP has clarified that taking input as separate arguments is OK - saved 13 bytes ... saved another 3 bytes by eliminating $b)
We're looping through the input $args a digit at a time. Each digit, we verify that the $last digit is -notequal to the current digit $_, and that 7-$_-$l is some number other than zero (which is truthy). Those Boolean results are encapsulated in parens and fed into the right-hand operand of the -notin operator, checking against 0. In other words, if there is any False value anywhere in the loop, the -notin will also be False. That Boolean is left on the pipeline, and output is implicit.
Lengthy because of the $ requirement for variable names, and that Boolean commands -ne -and are verbose in PowerShell. Oh well.

Brain-Flak 128 Bytes
(()){{}(({}<>)<>[({})])}{}([]){{{}}<>}{}([]){{}({}({})<>)<>([][()])}{}(<{}>)<>(([])){{}{}({}[(()()()){}()]){<>}<>([][()])}({}{})

Outputs 0 for falsey, or -7 for truthy.
Try it Online! (Truthy)
Try it Online! (Flasey)
Explanation (t stands for top and s stands for second from the top):
(())                # push a 1 to get this loop started
{{}                 # loop through all pairs, or until 2 are equal
(({}<>)<>[({})])    # pop t, push t on the other stack, and t - s on this one
}{}                 # end loop and pop one more time
([])                # push the height of the stack
{                   # if the height isn't 0 (there were equal numbers)...
{{}}<>              # pop everything from this stack and switch
}                   # end if
{{}                 # for every pair on the stack: pop the height and...
({}({})<>)<>        # push t + s on the other stack leaving s on this one
([][()])            # push the height - 1
}                   # end loop when there is only 1 number left
{}(<{}>)<>          # pop t, pop s, push 0 and switch stacks
(([]))              # push the height twice
{                   # loop through every pair
{}{}                # pop the height and what was t - 7
({}[(()()()){}()])  # push t - 7
{<>}<>              # if t is not 0 switch stacks and come come back
                    # if t is 0 (ie, there was a pair that added to 7) just switch once
([][()])            # push height - 1
}                   # end loop
({}{})              # push t + s (either 0 + 0 or 0 + -7)

MATLAB, 30 bytes
@(a)all(diff(a)&movsum(a,2)-7)

PHP, 63 bytes
for($d=$argv[$i=1];$c=$argv[++$i];$d=$c)$d-$c&&$d+$c-7?:die(1);

takes input as list of command arguments; exits with 1 (error) if input is invalid, 0 (ok) if valid.
Run with -nr.
input as string argument, 65 bytes
for($d=($s=$argv[1])[0];$c=$s[++$i];$d=$c)$d-$c&&$d+$c-7?:die(1);

C 47 44 bytes
F(char*s){return!s[1]||(*s^s[1])%7&&F(s+1);}

takes a string of digits (or a zero terminated array of bytes)
Explanation
F(char*s){
according to the standard int return type is implied. (saving 4 bytes)
return unconditional return because this is a recursive function
using shortcut evaluation:
!s[1]|| if the second character is nul return true
((*s^s[1])%7&& if the first two charcters aren't legal false
F(s+1)) check the rest of the string in the same way
that confusing expression
*s is the first character s[1] is the second
*s^s[1] exclusive-ors them together if they are the same the result is 0
  if they add to 7 the result is 7 , (if they differ and don't add to 7 the result is between 1 and 6 inclusive)
so (*s^s[1])%7 is zero for bad input and non-zero otherwise, thus false if these 2 characters are bad, and true otherwise
comment:  as this function call uses only end-recursion (only the last statement is a recursive call) an optimiser could translate the recursion into a loop, this is a happy conicidence and is obviously not worth any golf score, but in the real word makes it possible to process strings of any length without running out of stack.

About your !((*s^s[1])%7) I think you don't want the !.  Zero values for bad input would be falsy, so you want to return the falsy when it's bad.

Python, 71 bytes
f=lambda s:len(s)<2or(s[0]!=s[1]and int(s[0])!=7-int(s[1]))and f(s[1:])

Uses a recursive approach.
Explanation:
f=lambda s:                                                              # Define a function which takes an argument, s
           len(s)<2 or                                                   # Return True if s is just one character
                      (s[0]!=s[1]                                        # If the first two characters matches or...
                                 and int(s[0])!=7-int(s[1])              # the first character is 7 - the next character, then return False
                                                           )and f(s[1:]) # Else, recurse with s without the first character

say that the input is a list of ints, and then you don't need the casts.

Retina, 28 bytes
M`(.)\1|16|25|34|43|52|61
^0

Try it online!
Alternatively:
M`[16]{2}|[25]{2}|[34]{2}
^0

Try it online!

MATL, 9 bytes
dG2YCs7-h

The input is an array of numbers representing the digits.
The output is a non-empty array, which is truthy if all its entries are non-zero, and falsy otherwise (read more about MATL's criterion for truthy and falsy here).
Try it online! Or verify all test cases.
Explanation
d     % Take input implicitly. Consecutive differences
G     % Push input again
2YC   % Overlapping blocks of length 2, arranged as columns of a matrix
s     % Sum of each column
7-    % Subtract 7, element-wise
h     % Concatenate horizontally. Implicitly display

Is it possible/intended to add some new  MATLAB functions to MATL?

@rahnema1 Yes, there are some function names currently unused. However, I tend to be selective and add only those that I think will be used often. If you have any proposals we can discuss them in the MATL chatroom :-)

@rahnema1 If you are thinking of movsum, there's already conv2 (which includes conv); see Y+ and Z+

C# (with Linq) 90 81 73 71 69 68 Bytes
using System.Linq;n=>n.Aggregate((p,c)=>p<9|c==p|c==103-p?'\b':c)>9;

Explanation:
using System.Linq;           //Obligatory import
n=>n.Aggregate((p,c)=>       //p serves as both previous character in chain and error flag
    p<9                      //8 is the error flag, if true input is already invalid
        |c==p
            |c==103-p        //103 comes from 55(7) + 48(0)
                ?'\b'       //'\b' because it has a single digit code (8)
                    :c)      //valid so set previous character, this catches the first digit case as well
                        >8;  //as long as the output char is not a backspace input is valid

C, 81 bytes, was 85 bytes
int F(int *A,int L){int s=1;while(--L)s&=A[L]!=A[L-1]&A[L]!=(7-A[L-1]);return s;}

Input is an array of integers A with length L.
Returns 1 for true and 0 for false. The input is checked from the end to the start using the input length L as the array index.

int  is optional at the start, you can save 4 bytes.

int s=1; can be declared outside the function as s=1; for another 4.

68 bytes

Haskell, 37 bytes
f(a:b:c)=a+b/=7&&a/=b&&f(b:c)
f _=1<2

Usage example: f [1,5,2] -> False.
Simple recursion. Base case: single element list, which returns True. Recursive case: let a and b be the first two elements of the input list and c the rest. All of the following conditions must hold: a+b/=7, a/=b and the recursive call with a dropped.

JavaScript, 40 bytes
f=i=>i.reduce((a,b)=>a&&a-b&&a+b-7&&b,9)

Takes advantage of the JavaScript feature that && will return the last value that is parsed (either the falsy term or the last term). 0 is passed along if it doesn't meet the conditions, and the previous term is passed along otherwise. The 9 makes sure that it starts with a truthy value.

Groovy, 61 bytes
{i=0;!(true in it.tail().collect{x->x in [7-it[i],it[i++]]})}

Python 2, 58 Bytes
lambda x:all(x[i]!=x[i+1]!=7-x[i]for i in range(len(x)-1))

><>, 39 bytes
0>i'0'-::&0)?v1n;>&!
?=0+=7+@=}:{:<;n0^

Try it online!

Batch, 102 bytes
@set s=%1
@set/an=0%s:~0,2%,r=n%%9*(n%%7)
@if %r%==0 exit/b
@if %n% gtr 6 %0 %s:~1%
@echo 1

Ungolfed:
@echo off
rem grab the input string
set s=%1
:loop
rem convert the first two digits as octal
set /a n = 0%s:~0,2%
rem check for divisibility by 9 (011...066)
set /a r = n %% 9
rem exit with no (falsy) output if no remainder
if %r% == 0 exit/b
rem check for divisibility by 7 (016...061)
set /a r = n %% 7
rem exit with no (falsy) output if no remainder
if %r% == 0 exit/b
rem remove first digit
set s=%s:~1%
rem loop back if there were at least two digits
if %n% gtr 6 goto loop
rem truthy output
echo 1

Clojure, 55 49 46 bytes
edit 1: using (mapcat ...) instead of (flatten(map ...))
edit 2: using (juxt - +) instead of (juxt = +), checking for values 0 or 7
#(not(some #{0 7}(mapcat(juxt - +)(rest %)%)))

Consecutive values are not allowed to be equal (difference = 0) or sum up to 7. Got to use juxt again :)

JavaScript (ES6), 46 Bytes
a=>r=1&&a.reduce((c,p)=>r=c==p||c==7-p?0:1)&&r

f=a=>r=1&&a.reduce((c,p)=>r=c==p||c==7-p?0:1)&&r;

console.log(f([4,6]));
console.log(f([1,6]));

Bash, 60 bytes
f(){
while [ $2 ]
do
(( ($1^$2)%7 ))||return 1
shift
done
}

Takes separate arguments as input.
Explanation
while-do-shift-done loops though the arguments giving each pair a turn as ($1,$2) if the loop completes truth is returned.
The complicated expression  (( ($1^$2)%7 ))
exclusive-ors the the arguments being tested together and mod(7)s them.
Valid pairs will result in non-zero, invalid ones in zero.
((...)) yields true when the arithmetic returns non-zero.
|| runs the next command if the previous was false  (in this context that means if the arithmetic above returned 0).
Unix shell treats zero as true (except as above) so return 1 yields a false result from this function when an invalid pair is found.

Prolog (SWI), 45 bytes
p([A,B|T]):-A+B=\=7,A\=B,p([B|T]).
p([_|[]]).

Online interpreter

Math++, 111 bytes
?>b
0>n
n+1>n
b%10>{n}
_(b/1)>b
3+4*!b>$
0>n
n+1>n
10+4*!({n}-{n+1})>$
11+3*!(7-{n}-{n+1})>$
8+4*!{n}>$
1
0>$
0

Mathematica, 32 bytes
FreeQ[Most@#~BitXor~Rest@#,0|7]&

Unnamed function taking a list of integers as input and outputting True or False. Like many existing answers, it computes the bitwise XOR of consecutive elements of the input, and checks that the answer is never 0 nor 7.

PHP, 41 bytes
<?=!similar_text(aa^af,$s^s.$s=$argv[1]);

Takes input as a string. Prints 1 if the input is valid, an empty string otherwise.
Calculates XOR by pairs of adjacent characters, using shifted version of the input. Then searches for 0x00 or 0x07 characters in it.

SmileBASIC, 65 bytes
DEF T A
WHILE LEN(A)V=POP(A)IF!(O-V&&7-O-V)THEN?0A
O=V
WEND?1
END

This can definitely be made a little smaller

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
The Professor's base building number converter
The nutty maths professor wants to encode all of their research using a system sure to fox even the wiliest of their competitors!
To this end the professor has decided to change the base of not just the number that they're writing but every single digit in that number, according to which place the digit finds itself in (counting from the right, starting with 1). For example:
The number 0 has one digit, so it is represented in base 1: 0
The number 1 would have one digit in base ten, but in our professor's system that isn't valid. The first place is reserved for base 1 digits only! This means it must be bumped to the second place where base 2 is allowed: 10
The number 2 requires at least base 3 to be written: 100
But now the number 3 can be written by changing the digit in the second place: 110
and 4 as so: 200
Here are some more examples to help you get the idea:

5:210
6:1000
7:1010
8:1100
9:1110
10:1200
11:1210
12:2000
13:2010
14:2100
15:2110
16:2200
17:2210
18:3000

Using this system the professor's notes will make no sense to anyone but them, and they can finally take over the world!!!! sleep well at night.
Of course the encoding method must be as obscure as possible.

Your task is to write 10 code snippets, each representing one of the base 10 digits

0 1 2 3 4 5 6 7 8 9

which when combined in the order of the number to be converted will produce a number written in the professor's diabolical numbering system (the output method may be of your choice but must be a human readable number using only the digits 0-9)
For example if my snippets are:
0=MONKEY 1=EXAMPLE, 2=CODE, 3=GOLF and 9=TEST
then
19 = EXAMPLETEST -> 3010
20 = CODEMONKEY -> 3100
21 = CODEEXAMPLE -> 3110
22 = CODECODE -> 3200
23 = CODEGOLF -> 3210
No input numbers with more than 10 digits or negative numbers need to be considered, though if you want to write the code for additional digits you will get extra kudos. This is code golf, so shortest answer (using the combined byte totals of all snippets) wins and the standard loopholes aren't allowed.
ADDENDUM: Before anyone gets started on whether 0 is the correct representation of 0 in base 1 I would like to remind you that this professor is nutty. Live with it.

Note: The professor's system is also known as the factorial number system.

It's also OEIS A124252

@ETHproductions I never said the Professor's encoding was good.

@KritixiLithos Thank you for that! I was looking for that to use as confirmation.

Welcome to PPCG, by the way :-)

@ETHproductions: Thanks. I must confess to being a long time lurker...

You state: "Your task is to write 10 code snippets, each representing one of the base 10 digits".  Later, it seems that you want a conversion of a decimal number into a factorial base system.  Do you want "snippets" in English, or simply the conversion?

@DavidC: The code snippets are combined in order to act as the input to be converted, as shown in the example. There is already a factorial conversion challenge, but this is mostly about the novel input format.

Is including code outside of the snippets permitted as well? Or does all code used have to be in a snippet?

@Turtleman: All code should be in the snippet.

There is a lot of gender bias in mathematics. Assuming that a maths professor is male (as you do in the first sentence) not only is a symptom of our implicit bias, but also reinforces that harmful bias. I encourage you not to assign genders to hypothetical STEM people.

What do you want the output to be if the snippets indicate the number 36288000, which is 10 times 10! and thus has a two-digit "digit"?

@GregMartin: Feel free to edit to a gender neutral or fluid pronoun if you really want to. I was just going to assign the gender of the next hypothetical professor based on a coin flip.

0 is the correct representation of 0 in base 1, if you don't use 0s in unary. And the 0 is empty so yes.

Mathematica (REPL environment), 858 total bytes
Here is the 86-byte code snippet for the digit 9:
1;ValueQ@a||(a=0;b=3);a=10a+9;b++;FromDigits[a~IntegerDigits~MixedRadix@Range[b,1,-1]]

The code snippets for the digits 1 through 8 are identical, except that the 9 is replaced by the appropriate digit. The code snippet for the digit 0 is identical, except that +9 is simply deleted.
a~IntegerDigits~MixedRadix@Range[b,1,-1] computes the list of the factorial-number-system digits of a, as long as b is at least as large as the number of digits; FromDigits converts that list of digits to a regular base-10 integer for the purposes of output. (If any of the list elements exceeds 9, something funny happens.)
In Mathematica's REPL environment, computations can be terminated with semicolons to suppress the output; so only the last output in a semicolon-separated chain will be displayed. We recursively define the integer a designated by the snippets, and also a bound b on the number of factorial-system digits needed. The command ValueQ@a||(a=0;b=3) initializes these variables if they're uninitialized (i.e., in the first snippet) and leaves them alone otherwise; then a=10a+9;b++ carries out the recursion. Finally, the initial 1; is for gluing the snippets together: it multiplies intermediate computations by 1 (which we never see anyway).

I enjoy the semicolon abuse.

Goruby, 790 810 980
Here's a second attempt, relying on the fact that, in basically any shell, printing a carriage return ("\r") without a newline ("\n") will overwrite the previously printed line, ultimately ensuring that only the last bit printed (that is, the final result) is shown.
This must be run in a shell, e.g. ruby name_of_file.rb.
It works for positive numbers of unrestricted length.
The code is ten copies of the snippet below, with X (at the top) replaced with the digits from 0-9, one per snippet.
->*t{n,d,o="X#{t}".toi,0,''
dw{n,r=n.dm d+=1;o.pr r.ts;n>0}
$>.fu
pr"\r",o
o}

That is, the snippet representing (for example) 8 would look like:
->*t{n,d,o="8#{t}".toi,0,''
dw{n,r=n.dm d+=1;o.pr r.ts;n>0}
$>.fu
pr"\r",o
o}

The challenge states that the snippets need to be "combined" to create represent a multiple-digit number, so, to append a digit to a number, simply place it in the square brackets at the number's end. Thus, the number 103 (in decimal) would be:
->*t{n,d,o="1#{t}".toi,0,''
dw{n,r=n.dm d+=1;o.pr r.ts;n>0}
$>.fu
pr"\r",o
o}[->*t{n,d,o="0#{t}".toi,0,''
dw{n,r=n.dm d+=1;o.pr r.ts;n>0}
$>.fu
pr"\r",o
o}[->*t{n,d,o="8#{t}".toi,0,''
dw{n,r=n.dm d+=1;o.pr r.ts;n>0}
$>.fu
pr"\r",o
o}[]]]

You mean the number 108.


text:
Snowman Bowling
(related/inspired by: Draw a bowling formation)
A fun pastime in the winter months here is to perform snowman bowling, using a large ball (like a basketball) and tiny snowman figures. Let's recreate this in ASCII.
Each snowman consists of the following:
(.,.)
( : )

Here is the alignment of the ten snowman "pins"
(.,.) (.,.) (.,.) (.,.)
( : ) ( : ) ( : ) ( : )
   (.,.) (.,.) (.,.)
   ( : ) ( : ) ( : )
      (.,.) (.,.)
      ( : ) ( : )
         (.,.)
         ( : )

These "pins" are labeled from 1 to 10 as
7 8 9 10
 4 5 6
  2 3
   1

So far, so standard. However, unlike normal bowling, the snowman pins are merely flattened and not totally removed. This is done by someone needing to manually flatten the snow of any pins that were struck. A flattened snowman is represented by _____ (five underscores), with whitespace above. Here is an example with the 1 3 5 6 9 10 pins flattened (meaning only the 2 4 7 8 pins remain):
(.,.) (.,.)
( : ) ( : ) _____ _____
   (.,.)
   ( : ) _____ _____
      (.,.)
      ( : ) _____

         _____

Input

A list of integers from 1 to 10 in any convenient format representing which pins were struck and thus need to be flattened.
Each number will only appear at most once, and the numbers can be in any order (sorted, unsorted, sorted descending) -- your choice, whatever makes your code golfier.
The input is guaranteed to have at least one integer.

Output
The resulting ASCII art representation of the snowman pins, with the correct pins flattened.
Rules

Leading or trailing newlines or whitespace are all optional, so long as the characters themselves line up correctly.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
1 3 5 6 9 10

(.,.) (.,.)
( : ) ( : ) _____ _____
   (.,.)
   ( : ) _____ _____
      (.,.)
      ( : ) _____

         _____

1 2 3

(.,.) (.,.) (.,.) (.,.)
( : ) ( : ) ( : ) ( : )
   (.,.) (.,.) (.,.)
   ( : ) ( : ) ( : )

      _____ _____

         _____

1 2 3 4 5 6 8 9 10

(.,.)
( : ) _____ _____ _____

   _____ _____ _____

      _____ _____

         _____

Code golf?   Not code bowling?

Can we take the input numbers indexed from 0? And if possible take the input values without spaces such like 0123456789 instead of 1 2 3 4 5 6 7 8 9 10?

Perfect :D it allows me to make an easier attempt in ><>

I do not approve of flattening snowmen.

i identify myself as a snowman and find this flattening.

05AB1E, 45 44 bytes
TF"(.,.)( : )"„ _5×{«4ä2ä¹N>åè})4L£Rvyø»}».c

Try it online!
Explanation
TF                                           # for N in [0 ... 9] do:
  "(.,.)( : )"                               # push string
              „ _                            # push the string " _"
                 5×                          # repeat it 5 times
                   {                         # sort
                    «                        # concatenate the strings
                     4ä                      # split the string in 4 parts
                       2ä                    # split the list in 2 parts
                         ¹N>åè               # if index+1 is in the input, push the first part
                                             # else push the second part
                              }              # end loop
                               )             # wrap stack in a list
                                4L£          # split list in parts of size 1,2,3,4
                                   R         # reverse list
                                    v        # for each list in list of lists
                                     yø      # transpose the list
                                       »     # join by spaces and newlines
                                        }    # end loop
                                         »   # join by newlines
                                          .c # centralize

Snowman 1.0.2, 157 bytes
(()("789:045600230001"4aG::48nSdU][:#:]eq]/nM;AsI[:"_____"wR["     "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI;:"  "wRdUaC;bI\#**\;aMaZ:" "aJ1AfL;aM;aM1AfL"
"aJ1AfL*))

Try it online!
When I saw this challenge, I knew I just had to answer in the perfect language...
This is a subroutine that takes input as an array of numbers and outputs as a string via the current permavar.
Wrapped for "readability" / aesthetics:
(()("789:045600230001"4aG::48nSdU][:#:]eq]/nM;AsI[
:"_____"wR["     "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI
;:"  "wRdUaC;bI\#**\;aMaZ:" "aJ1AfL;aM;aM1AfL"
"aJ1AfL*))

Slightly ungolfed / commented version:
}
1wR`
3wR`aC`
5wR`aC`
6wR`aC`
9wR`aC`
*

((
    )(
    "789:045600230001"  // pin layout data
    4aG                 // split into groups of 4; we need each row twice
    :                   // map over groups of 2 output lines
        :               // map over pins (or whitespace)
            48nS        // subtract ascii '0'
            dU][        // duplicate the pin; we need it in the if{}
            :           // if (pin) {
                #:]eq]/nM;AsI[:"_____"wR["     "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI
            ;:          // } else {
                "  "wRdUaC
            ;bI         // }
            \#**\       // maneuver the permavars around to discard pin
        ;aM
        aZ:" "aJ1AfL;aM
    ;aM
    1AfL                // flatten (simulate a flatmap)
    "
"aJ                     // join on newline
    1AfL                // flatten again into a single string
    *
))

#sP

Pretty much the only context that this will be known as "the perfect language", :P

A snowman killing his own kind... You monster!

stacked, noncompeting, 118 bytes
I added deepmap and a few other things after this challenge, along with tons of bugfixes. Try it here!
@a((7 8 9 10)(4 5 6)(2 3)(1)){e:('(.,.)
( : )' '
_'5 hrep)a e has#'  'hcat
}deepmap{e i:'
 'i 3*hrep e,$hcat#/!LF+}map

Ungolfed
{ a :
  ((7 8 9 10) (4 5 6) (2 3) (1))
  { e :
    (
      '(.,.)' LF '( : )' + +
      ' ' LF '_' + + 5 hrep
    ) @possible
    a e has @ind
    possible ind get @res
    '  ' @padding
    res padding hcat return
  } deepmap
  { e i:
    ' ' LF ' ' + + i 3 * hrep
    e ,
    $hcat insert!
    LF +
  } map
} @:bowl

(1 2 3 4 6 10) bowl out

Output:
(.,.) (.,.) (.,.)
( : ) ( : ) ( : ) _____
         (.,.)
   _____ ( : ) _____

      _____ _____

         _____

This language looks great. The Fisher-Yates example in the wiki is beautiful.

@Jordan thank you so much! that means a lot to me :)

Python 2, 248 243 241 226 224 223 221 210 206 200 177 bytes
-5 with thanks to @Rod
-15 again thanks to Rod
-1 using space calculation again from Rod
Looks longer due to more lines and indents but surprisingly 11 bytes shorter.
I'm sure this will go under 200...
I was right but not without 23 bytes worth of serious hints from @Pietu1998. Many thanks!
i,z=input(),0;m=['']*10;n=m[:]
for x in range(11):m[x-1],n[x-1]=('(.,.)',' '*5,'( : )','_'*5)[x in i::2]
for y in 10,6,3,1:
 for q in m,n:print' '*3*z+' '.join(q[y-4+z:y])
 z+=1

Try it online!
Takes input as a list of integers. Way too big at 248 but it works.

Let us continue this discussion in chat.

C# 233 221 213 203 bytes
method takes an int array a as the list of fallen pins
string S(int[]a){string o="",x=o,y=o,z=o;for(int i=10;i>0;){var c=a.Contains(i);x=(c?"      ":"(.,.) ")+x;y=(c?"_____ ":"( : ) ")+y;if(i==7|i<5&i--!=3){o+=$"{z}{x}\n{z}{y}\n";x=y="";z+="   ";}}return o;}

wrapped
string S(int[]a){string o="",x=o,y=o,z=o;for(int i=10;i>0;)
{var c=a.Contains(i);x=(c?"      ":"(.,.) ")+x;y=(c?"_____ ":
"( : ) ")+y;if(i==7|i<5&i--!=3){o+=$"{z}{x}\n{z}{y}\n";x=y="";
z+="   ";}}return o;}

expanded
string S(int[] a)
{
    string o = "", x = o, y = o, z= o;
    for (int i = 10; i > 0;)
    {
        var c = a.Contains(i);
        x = (c ? "      " : "(.,.) ") + x;
        y = (c ? "_____ " : "( : ) ") + y;

        if (i==7|i<5&i--!=3)
        {
            o += $"{z}{x}\n{z}{y}\n";
            x = y = "";
            z += "   ";
        }
    }
    return o;
}

knocked off a few bytes by suggestions in comments from Ghost, raznagul and auhmaan.

Welcome to PPCG!

nice! You can save a few bytes (5?) if you put the i-- in the for and change new[]{7,4,2,1}.Contains(i--) to i<9&&i%3==1||i==2

Can improve that by two more (for -7) with i==7||i<5&&i!=3

@Ghost thanks! knocked it down a bit more by using non-shortcurcuit ors and ands, and still decrementing with the final ref to i i==7|i<5&i--!=3

You can save some bytes by replacing var o="";var x=... by string o="",x=""....

@raznagul thanks! edited and credited

You can save a few bytes by changing string o="",x="",y="",z="" to string o="",x=o,y=o,z=o. Also, you can swap the if/else you have with a ternary, slightly confusing, but saves some bytes.

Batch, 262 bytes
@echo off
for /l %%i in (1,1,10)do set s%%i=( : )
for %%i in (%*)do set s%%i=_____
set l=call:l
%l%%s7%%s8%%s9%%s10%
%l%"   %s4%%s5%%s6%
%l%"      %s2%%s3%
%l%"         %s1%
exit/b
:l
set s=%~1
set s=%s:( : )=(.,.)%
echo(%s:_____=     %
echo(%~1

Note: Lines 2, 3 and 4 end in a space, and also outputs a trailing space on each line. These can be removed at a cost of 5 bytes. Works by creating variables s1...s10 as the bottom halves of the snowmen, then flattening the ones given as command-line arguments. The appropriate rows are printed twice, the first time with the bottom halves replaced with the top halves. This saves 18 bytes over using two sets of top and bottom half variables.

That's a slick answer.

JavaScript, 154 149 bytes

f=
a=>`6 7 8 9
_3 4 5
__1 2
___0
`[r='replace'](/\d|_/g,m=>++m?~a.indexOf(m)?'_____':'( : )':'   ')[r](/.*\n?/g,m=>m[r](/ : |_/g,s=>s=='_'?' ':'.,.')+m)

I.oninput=()=>O.innerHTML=f(JSON.parse(`[${I.value.match(/\d+/g)}]`))
I.oninput()
<input id=I value="1 3 5 6 9 10"><pre id=O>

Pyth, 63 bytes
j.ejm+**3k;j;db)_CcR[1 3 6).e:*T]btMQ@m*T]*5d,d\_kc2"(.,.)( : )

A program that takes input of a list of integers and prints the result.
Test suite
[Explanation coming later]

Pyth, 51 bytes
The code contains some unprintables, so here is an xxd hexdump.
00000000: 6a6d 2e5b 3233 5f6a 3b6d 4063 323f 7d6b  jm.[23_j;m@c2?}k
00000010: 5172 2235 2035 5f22 392e 2220 3b5b 8db2  Qr"5 5_"9." ;[..
00000020: 1778 a822 6472 4673 4d50 4253 2d34 2f64  .x."drFsMPBS-4/d
00000030: 323b 38                                  2;8

Try it online.
Without unprintables, 52  bytes
jm.[23_j;m@c2?}kQr"5 5_"9").,.() : ("drFsMPBS-4/d2;8

Try it online.

Javascript 178 169 bytes
Essentially a port from my C# answer.
Takes an int array as the list of flattened "pins";
f=a=>{o=x=y=z="";for(i=10;i>0;){c=a.includes(i);x=(c?"      ":"(.,.) ")+x;y=(c?"_____ ":"( : ) ")+y;if(i==7|i<5&i--!=3){o+=z+x+"\n"+z+y+"\n";x=y="";z+= "   ";}}return o}

Wrapped:
f=a=>{o=x=y=z="";for(i=10;i>0;){c=a.includes(i);
x=(c?"      ":"(.,.) ")+x;y=(c?"_____ ":"( : ) ")+y;
if(i==7|i<5&i--!=3){o+=z+x+"\n"+z+y+"\n";x=y="";
z+= "   ";}}return o}

Expanded & Explained:
// function f takes parameter a (an array of ints)
f = a => {

    // four strings:
    // o: output
    // x: top row of snowmen
    // y: bottom row of snowmen
    // z: padding to indent the snowmen
    o = x = y = z = "";

    // loop from 10 to 1 (the pins)
    // remove the "afterthought" decrement - we can do that later
    for (i = 10; i > 0;) {

        // set the boolean c to whether the current pin has been flattened
        c = a.includes(i);

        // prefix x and y with the appropriate "sprite"
        // using a ternary if on c
        x = (c ? "      " : "(.,.) ") + x;
        y = (c ? "_____ " : "( : ) ") + y;

        // determine if we've reached the end of a row (i equals 7, 4, 2 or 1)
        // use non shortcircuit operators to save bytes and ensure we hit the final i, because...
        // we also decrement i here
        // (we didn't do this in the for loop declaration to save a byte)
        if (i == 7 | i < 5 & i-- != 3) {

            // concatenate our rows x & y,
            // prefixing them with the padding z,
            // postfixing them with a newline
            o += z + x + "\n" + z + y + "\n";

            // reset x and y rows
            x = y = "";

            // increase our padding for next time
            z += "   ";
        }
    }

    // return our final string (no semicolon to save a byte)
    return o
}


text:
A Square of Squares
Given two input integers, a >= 4 and b >= 2, output an ASCII square of size a x a. The twist is the square must be constructed of b 3 x 3 squares formed like the following:
###
# #
###

You can use any ASCII printable character (except whitespace) to construct the smaller squares. I'm using # for visibility and consistency.
The first b square is always placed in the upper-left, and the remaining b squares must be as evenly spaced as possible, going clockwise, around the larger square. The overall a x a square size is calculated in characters based on the center of the b squares.
Here's an example for a=7 and b=3. Note the numbers around the outside are not part of the output, just used to illustrate the construction.
   1234567
  ###
1 # #       1
2 ###   ### 2
3       # # 3
4       ### 4
5           5
6   ###     6
7   # #     7
    ###
   1234567

The first b square is placed in the upper-left corner. In the remaining possible areas on the perimeter of a x a, we need to place two more b squares. Note how the smaller squares are staggered -- how they're spaced as evenly as possible around the larger square. If a potential b square could be in one of two spaces, your code can pick either and does not need to be deterministic.
Here's another diagram explaining the spacing. I've drawn the a square with -+| and marked the center of the smaller b squares with *. If we count clockwise around the outside of the a square, we have 7 characters between the first and second centers -----+|, 7 between the second and third |||+---, and again 7 between the third and first -+|||||. This lines up mathematically as well, since we have 24 total characters making up the a square, minus 3 for the center of the b squares, must mean we have 7 characters between the centers. And, since the upper-left b square is fixed, this is the most evenly spaced arrangement possible.
   1234567
  ###
1 #*-----+  1
2 #|#   #|# 2
3  |    #*# 3
4  |    #|# 4
5  |     |  5
6  |###  |  6
7  +-*---+  7
    ###
   1234567

Input

A two integers in any convenient format, a >= 4 and b >= 2.
You can take the input in either order -- your choice.
The input is guaranteed to be such that no b squares will overlap.

Output
The resulting ASCII art representation of the squares.
Rules

Leading or trailing newlines or whitespace are all optional, so long as the characters themselves line up correctly.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
(note these are just examples, and depending upon how your code rounds the placement you may have slightly different output)
a=4, b=4
######
# ## #
######
######
# ## #
######

a=4, b=2
###
# #
###
   ###
   # #
   ###

a=7, b=4
###   ###
# #   # #
###   ###

###   ###
# #   # #
###   ###

a=5, b=3
###
# #
### ###
    # #
 ######
 # #
 ###

a=7, b=3
###
# #
###   ###
      # #
      ###

  ###
  # #
  ###

a=7, b=5
###  ###
# #  # #
###  ###

###   ###
# ##### #
#### ####
   ###

How do you determine what's "spaced as evenly as possible"? I would guess this is more evenly spaced than your example for a=7, b=3? http://pastebin.com/vkPxRh61

@milk Your paste has only five characters between the bottom left and upper left squares, significantly different than between the two left squares and the right square. I've added an additional diagram explaining the spacing.

Befunge, 240 232 bytes
< vp62:&p01*4p00:-1&
-1<v3!-2\*g04!:::p04p03-\g00:%g00\/g00:/g62*g01\1:
p:|>0g*+\1-!00g*+2+\::1-!40g*\3-!30g*+\2-!00g*+9+
# >00g3+:00pv
g00p05-\g00:<v+g06%3:\!!-4::-1p07\<90p06-\g00:<
$55+,1-:!#@_^>\3/50g+7+g2%*70g+\:#^_$!3g,>1-:#^_

Try it online!
Explanation
There are two parts to this. The first part is mostly handled by the loop on lines 2 and 3, which calculates the positions of each block by dividing the route around the main square (of length (a-1)*n4) into b segments. For each division, d, in that length, we determine the x and y coordinates with:
side = d/(a-1)    // which side of the square (0 = top, 1 = right, 2 = bottom, 3 = left)
off  = d%(a-1)    // the offset along that side, in a clockwise direction
roff = a-1-off    // the reverse of that offset

x = (side==0)*off + (side==2)*roff + (side==1)*(a-1)
y = (side==1)*off + (side==3)*roff + (side==2)*(a-1)

i.e. depending on which side of the square we're on, the coordinate value will either be the offset along that side, the reverse offset, the width of the square, or zero. We use those coordinates to write a 1 into the lower half of the Befunge playfield to mark the spot for later output.
The second part, writing out the final pattern of squares, is handled by the triple loop on lines 5 and 6. We're looping over the y and x coordinates, and then for each point, we need to check if we've marked a spot in any of the surrounding 8 locations. This is achieved with a simple loop over a range of 9, basically summing the values it encounters in the playfield. In Python it would look something like this:
total = sum(playfield[y+i/3][x+i%3] * (i != 4) for i in range(9))

The multiplication by i != 4 is so that we exclude the centre point in the range. If this total is greater than 0 we need to output a #, otherwise we output a space. To avoid any branching, we simply use !total as an index into a character "table" (the #  at the start of line 3) to determine the character to output.

C, 350 302 253
i,j,x,y,a,b,c;main(){scanf("%d%d",&a,&b);a+=3;char*s,o[a*a];for(;c<a;)sprintf(o+c++*a,"%*s\n",a-1,"");for(;i<b;){x=y=0;for(j=(a-4)*i++*4/b;j--;)y>0&!x?y--:y>a-5?x--:x>a-5?y++:x++;s=o+y*a+x;s[2]=s[1]=*s|=3;s+=a;s[2]=*s|=3;s+=a;s[2]=s[1]=*s|=3;}puts(o);}

Ungolfed:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int i,j,x,y,a,b,c;
main(int n, char** v) {
    a = atoi(v[1])+3;
    b = atoi(v[2]);
    char o[a*a-a], *s;
    for (; c < a-1; c++) {
        sprintf(o+c*a, "%*s\n",a-1," ");
    }
    for (; i < b; i++) {
        x=y=1;
        for(j=(a-4)*i*4/b;j--;){ // Set the number of steps from 1,1
            if(y>1&x<2) y--; // We are on the left wall
            else if(y>a-4) x--; // We are on the bottom
            else if(x>a-4) y++; // We are on the right wall
            else x++; // We are on the top
        }
        s = o+(y-1)*a+x-1; // Find the output position
        bcopy("#x#",s,3);
        s+=a;
        bcopy("# #",s,3);
        s+=a;
        bcopy("#y#",s,3);
    }
    printf("%s\n", o);
}

This compiles with gcc under linux.  Windows might substitute <windows.h> for the <stdlib.h> and <stdio.h> includes.
Explanation
We initialize the output string to an array of newline-terminated rows.  sprintf takes care of null-terminating the string.  We descend into a nested group of ternary operators to determine the wall.  We then write out the square.  We start each square counting from (1,1).  This is less efficient but saves a few bytes over the step method.  It also avoids rounding errors in integer division.


text:
Sloping Binary Numbers
Given an integer n, output the first n sloping binary numbers, either 0- or 1-indexed. They are called this because of how they are generated:
Write numbers in binary under each other (right-justified):
........0
........1
.......10
.......11
......100
......101
......110
......111
.....1000
.........

Then, you need to take each diagonal from bottom-left to top-right, such that each final digit is the final digit of a diagonal. Here's the fourth diagonal (zero-indexed) marked with x's, which is 100:
........0
........1
.......10
.......11
......10x
......1x1
......x10
......111
.....1000
.........

The upward-sloping diagonals in order are:
0
11
110
101
100
1111
1010
.......

Then, convert to decimal, giving 0, 3, 6, 5, 4, 15, 10, ...
OEIS A102370
This is code-golf, so the shortest code in bytes wins.

I don't think this specification is very clear.   I had to do a good deal of external reading before I could understand what was being asked here.

Here's a visualization, if it helps. Read the "ovals" top to bottom, and within the oval from bottom left to top right. Those give you the binary numbers you need to convert to decimal.

What do you mean, "either 0- or 1-indexed"? Do you mean that one may output either the first n or the first n+1 numbers?

@Flp.Tkc yes, thanks for pointing that out. I edited the question and tagged it as such. (not OP)

Hopefully I made it clearer.

I think this might have allowed more interesting answers if you just had to return the n'th value.

@xnor I thought people might just use the formula on OEIS either way. I didn't know which would be better.

The specification makes sense to me, but if you're going to output the first N numbers sloped up like this, shouldn't you be generating the first N + binlen(N) or so numbers?

@PatrickRoberts I never put a limit on how many to generate. I simply said "write numbers in binary...". You generate as many as you need to.

Jelly, 11 bytes
ḤḶBUz0ŒDUḄḣ

Try it online!
Explanation
ḤḶBUz0ŒDUḄḣ    Main link. Argument: n
Ḥ              Double the argument. This ensures there are enough
               rows, since n + log2(n) <= 2n.
 Ḷ             Get range [0 .. 2n-1].
  B            Convert each number to binary.
   U           Reverse each list of digits.
    z0         Transpose, padding with zeroes to a rectangle.
      ŒD       Get the diagonals of the rectangle, starting from the
               main diagonal. This gets the desired numbers, reversed,
               in binary, with some extras that'll get dropped.
        U      Reverse each diagonal.
         Ḅ     Convert each diagonal from binary to a number.
          ḣ    Take the first n numbers.

The transpose is the simplest way to pad the array for the diagonals builtin to work. Then the reverses are added to get everything in the correct order.

The implementation of the OEIS formula might also be really short in Jelly.

@TuukkaX Might be. I'm tired enough to find picking an upper limit for the sum hard.

@TuukkaX I tried it, but I don't see it happening. I'm sure Dennis & co will implement it in 5 bytes or so.

Currently you are lucky ;)

JavaScript (ES6), 53 bytes
n=>[...Array(n)].map(g=(j=1,i)=>j>i?0:j&i|g(j+j,i+1))

0-indexed. It's not often I get to use a recursive function as a parameter to map.

Mathematica, 46 bytes
Plus@@@Table[BitAnd[n+k,2^k],{n,0,#},{k,0,n}]&

Unnamed function taking a nonnegative integer # as input and returning the 0-index sequence up to the #th term. Constructs the sloping binary numbers using BitAnd (bitwise "and") with appropriate powers of 2.

Python3, 63 61 bytes
lambda i:[sum(n+k&2**k for k in range(n+1))for n in range(i)]

Uses the formula from OEIS.
-2 bytes thanks to Luis Mendo! i+1 --> i

Can you explain how you went from Sum_{ k >= 1 such that n + k == 0 mod 2^k } 2^k to that simpler bitwise formula?

@smls It just calculates the upward diagonals directly. I actually thought it was more obvious than the other form.

MATL, 18 17 bytes
:q"@tt:+5MW\~fWs+

Try it online!
This uses the formula from OEIS:
a(n) = n + Sum_{ k in [1 2... n] such that n + k == 0 mod 2^k } 2^k

Code:
:q"     % For k in [0 1 2 ...n-1], where n is implicit input
  @     %   Push k
  tt    %   Push two copies
  :     %   Range [1 2 ... k]
  +     %   Add. Gives [n+1 n+2 ... n+k]
  5M    %   Push [1 2... k] again
  W     %   2 raised to that
  \     %   Modulo
  ~f    %   Indices of zero entries
  W     %   2 raised to that
  s     %   Sum of array
  +     %   Add
        % End implicitly. Display implicitly

PHP, 68 bytes
for(;$n++<$argv[1];print$s._)for($s=$i=0;$i<$n;)$s|=$n+$i-1&1<<$i++;

takes input from command line argument, prints numbers separated by underscores. Run with -r.

Perl 6, 59 43 bytes

{map ->\n{n+sum map {2**$_ if 0==(n+$_)%(2**$_)},1..n},^$_}

{map {sum map {($_+$^k)+&2**$k},0..$_},^$_}

Uses the formula from the OESIS page.
Update: Switched to the bitwise-and based formula from TuukkaX's Python answer.
Perl 6, 67 bytes
{map {:2(flip [~] map {.base(2).flip.comb[$++]//""},$_..2*$_)},^$_}

Naive solution.
Converts the numbers that are part of the diagonal to base 2, takes the correct digit of each, and converts the result back to base 10.

Jelly, 15 bytes
2*ḍ+
ḶçÐ€ḶUḄ+Ḷ’

This would be shorter than the other Jelly answer if we had to print only the nth term.
Try it online!

R, 66 bytes
function(n,k=0:length(miscFuncs::bin(n-1)))sum(bitwAnd(k+n-1,2^k))

Unnamed function which uses the bin function from the miscFuncs package to calculate the length of n represented in binary and then using one of the OEIS formulas.


text:
Print me a Tower Block
Print a tower block with the shortest possible code.
Input:
The input defines how many floors the tower block has. One floor contains a window on either side of the door. The window is made up of 3x3 hashes.
An example of a 4 storey tower block is below:
      =====================
      )V V V V V V V V V V(
     )V V V V V V V V V V V(
    )V V V V V V V V V V V V(
   )V V V V V V V V V V V V V(
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   : : : : : : : : : : : : : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : : : : : : : : : : : : :
   : : : : : : : : : : : : : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : : : : : : : : : : : : :
   : : : : : : : : : : : : : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : ### : : : : : : ### : :
   : : : : : : : : : : : : : :
   : : : : : _______ : : : : :
   : : ### : I     I : ### : :
   : : ### : I     I : ### : :
   : : ### : I     I : ### : :
   : : : : : I     I : : : : :

Update:
The input has to be one or greater.
Trailing spaces at the end of lines are allowed.
In my example, every line has three leading spaces. This isn't mandatory, just the tower block with the input is.

Can the input be less than 1?

Are trailing spaces at the end of lines allowed?

Thanks for your questions - please see the update in my question.

V, 72 bytes
13iV r(É)3ñÄ¯lxñÄ21r=GÙÒ~Ù14R: ÙÄ2w3r#7w.3ÄkdGÀpG4k5w7r_bêojrIÎfIl5r

Try it online!
Here is a hexdump, since this contains unprintable characters:
00000000: 3133 6956 201b 7228 c929 33f1 c4af 6c78  13iV .r(.)3...lx
00000010: f1c4 3231 723d 47d9 d27e d931 3452 3a20  ..21r=G..~.14R:
00000020: 1bd9 c432 7733 7223 3777 2e33 c46b 6447  ...2w3r#7w.3.kdG
00000030: c070 4734 6b35 7737 725f 1662 ea6f 6a72  .pG4k5w7r_.b.ojr
00000040: 49ce 6649 6c35 7220                      I.fIl5r

I ran into a strange bug. The section in the middle: dGÀpG should have been: ÀäGG, but this does not work for inputs of 1, and I have no idea why. ¯\_(ツ)_/¯

Mathematica, 301 288 258 bytes
" "~(s=If[#2==0,"",#~StringRepeat~#2]&)~3<>{"="~s~21,"
",s[" ",12-#]<>{")","v "~s~#,"v(
"}&/@9~Range~12,"~"~s~27,"
",s[(x=(u=": ")~s~13<>":
")<>{y=u<>{z=": ### ",v=u~s~5,w=z<>": :
"},y,y,x},#-1],v,"_"~s~7," ",v,"
",m=u<>{z,u,n="I     I ",w},m,m,v,n,w}&

Pure function which takes a positive integer and outputs a string. The output string won't look right because Mathematica apparently doesn't display monospace fonts as monospace:

For reasons I don't quite understand, it does format as monospace if you Print the string:

Edit: Saved several bytes by not including "   " at the beginning of each line. Changed the definition of s to handle the case where there is only one floor (StringRepeat doesn't like repeating a string 0 times).
Edit 2: Thanks to LegionMammal978 and the fact that StringJoin is Listable, this is now an incomprehensible nightmare of nested lists and also 30 bytes shorter.

At least 26 bytes can be saved by replacing a<>b<>...<>x with a<>{b,...,x} in certain parts.

Python 2, 275 270 262 246 240 236 bytes
Saved a couple with a hint from @Flp.Tkc and by changing the first for loop.
16 saved with more help from @Flp.Tkc
a,h,b,c,w=' ',"I  ",": "," :","#"*3;d,e,j=b*2+w+a+b+h,b*5+h,[b*14]
print'\n'.join([a*3+'='*21]+[a*(4-x)+')'+'V '*(x+8)+'V('for x in 1,2,3,4]+['-'*27]+(j+[b*2+w+c*6+a+w+c*2]*3+j)*(input()-1)+[b*5+"_"*7+c*5]+[d+a+d[::-1]]*3+[e+a+e[::-1]])

Try it online!
Just builds each line of the tower as a string and adds it to an array them prints the array at the end. If anyone wants a full explanation I'll grudgingly give if I  can  remember how it works ☺

T-SQL, 378 372 353 331 325 bytes
Golfed:
DECLARE @ INT=3

,@h varchar(max)=REPLICATE('~',27)SELECT @h+='
: '+a+IIF(n>@*5-6,IIF(n%5=0,'_______ ','I     I '),t)+a+':'FROM(SELECT
IIF(n%5%4=0,t,': ### : ')a,*FROM(SELECT': : : : 't,number n,*FROM spt_values)x)y
WHERE type='P'and n<@*5SET @=0WHILE @<4SELECT
@h=SPACE(@)+')'+REPLICATE('V ',12-@)+'V(
'+@h,@+=1PRINT'   '+REPLICATE('=',21)+'
'+@h

Ungolfed:
DECLARE @ INT=3

,@h varchar(max)=REPLICATE('~',27)
SELECT @h+='
: '+a+IIF(n>@*5-6,IIF(n%5=0,'_______ ','I     I '),t)+a+':'
FROM
(SELECT IIF(n%5%4=0,t,': ### : ')a,*
FROM
(SELECT': : : : 't,number n,*
FROM spt_values)x)y
WHERE type='P'and n<@*5
WHILE @>=0
  SELECT @h=SPACE(3-@)+')'+REPLICATE('V ',9+@)+'V(
'+@h,@-=1
PRINT'   '+REPLICATE('=',21)+'
'+@h

Try it out

PowerShell, 193 bytes
"   "+"="*21
3..0|%{" "*$_+")"+"V "*(12-$_)+"V("}
"~"*27
--$args[0]..0|%{($b=": "*5)+(($a=": "*4),'_______ ')[!$_]+$b;,(': : ### : '+($a,($c='I     I '))[!$_]+': ### : :')*3;$b+($a,$c)[!$_]+$b}

Try it online!
(I feel there may still be a few bytes here or there. Sub-190 seems doable.)
The first three lines form the roof, using string multiplication and concatenation, along with a loop 3..0|%{...} to get the correct number and sloping of Vs.
The next line runs from the input pre-decremented --$args[0] down to 0 as a loop (the pre-decrement allows us to index using !$_ instead of $_-eq1 saving several bytes later). Each loop iteration, we're constructing a bunch of strings, setting variables $b and $a along the way. We're also using pseudo-ternaries (... , ...)[...] to choose the appropriate strings for the middle so we can get the doorway on the first floor correct.
Each of the strings are left individually on the pipeline, and the default Write-Output inserts newlines between, so we get those for free.

C, 409 406 402 bytes
#define P(x)p(": ",x);
#define S(x)p(x,1);
#define L P(2)p("#",3);p(" :",6);S(" ###");S(" : :\n")
#define Q p("V ",i+++9)
p(s,n)char*s;{printf(s,--n?p(s,n):0);}i;t(n){p(" ",3);p("=",21);S("\n   )")Q;S("V(\n  )")Q;S("V(\n )")Q;S("V(\n)")Q;S("V(\n")p("~",27);S("\n")for(;--n;){P(13)S(":\n")L;L;L;P(13)S(":\n")}P(5)p("_",7);p(" :",5);S("\n")p(": : ### : I     I : ### : :\n",3);P(5)S("I     I")p(" :",5);}

Call with:
int main()
{
    t(4);
}

Batch, 373 bytes
@echo off
set s=###
echo    %s:#========%
for %%s in ("   )" "  )V " " )V V " ")V V V ")do echo %%~sV%s:#= V V V%(
echo %s:#=~~~~~~~~~%
set t=: : ### : I     I : ### : :
set s=%t:I     I=: : : :%
for /l %i in (2,1,%1)do echo %s:###=: :%&echo %s%&echo %s%&echo %s%&echo %s:###=: :%
set s=%t:###=: :%
echo %s:I     I=_______%
echo %t%
echo %t%
echo %t%
echo %s%

Builds the ridge and gutter by noticing that they are multiples of 3, which shaves off a few bytes. Builds the roof by noticing that the suffix is the same for each line (and again includes some threefold repetition). Builds the walls by starting with the most interesting line of wall, which is the ground floor window, and removing details to generate the other parts of the wall.

Javascript, 335 bytes
y=z=>{a="   "+"=".repeat(21);for(b=9;13>b;b++)a+="\n"+" ".repeat(12-b)+")"+"V ".repeat(b)+"V(";a+="\n"+"~".repeat(27);b="\n"+": ".repeat(14);c=": : ### : : : : : : ### : :";for(d=0;d<z-1;d++)a+=b+"\n"+c+"\n"+c+b;a+="\n: : : : : _______ : : : :\n"+": : ### : I     I : ### : :\n".repeat(3)+": : : : : I     I : : : : :";console.log(a)};

Creates a function y() with argument z, such that y(z) produces the desired output.
Example Usage:
y=z=>{a="   "+"=".repeat(21);for(b=9;13>b;b++)a+="\n"+" ".repeat(12-b)+")"+"V ".repeat(b)+"V(";a+="\n"+"~".repeat(27);b="\n"+": ".repeat(14);c=": : ### : : : : : : ### : :";for(d=0;d<z-1;d++)a+=b+"\n"+c+"\n"+c+b;a+="\n: : : : : _______ : : : :\n"+": : ### : I     I : ### : :\n".repeat(3)+": : : : : I     I : : : : :";console.log(a)};

console.log(y(3));

I'm transitioning from normal JavaScript to code-golf JS. Any tips would be greatly appreciated.

Canvas, 62 61 bytes
⁶=⁵×V７× ＊ )×４＊∔／‾²ｍ~７«× ×∔│８ ×:＊５＊#３３＊６２╋│⁸＊∔ｌ４－_７× ５×Iｅ４＊∔╋╋

Try it here! Input 0 works as expected even though that's not required.

hey, how is the height of the house modified using this script ?

My old eyes missed the number in the right box