text:
Become the Champion
Tic-Tac-Latin!
This is a true story, so names have been altered.
My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.
Formal rule declaration
A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.

You score one point when you have three of your symbol and one of the other character.

These arrangements score:

---O
-O--
XXXO
XOOX

O-XX
-O--
--X-
---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

The game is won whenever one player has more points then another. The game is a draw only if the board gets filled up.
Challenge
Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.

Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).

This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.
The winner is chosen by going down this list till one winner is chosen.

Shortest solved implemenation which always wins
Shortest implementation

"First the quality of play is looked at" Don't you think it's subjective?

The task of providing an interface to play seems peripheral of writing a perfect player. I'd suggest simply passing the current game state as input and requiring the code to output a winning move, or even simply an evaluation under perfect play (win, draw, lose).

A solution can be golfy by doing an inefficient brute force search. Are you OK if the code runs very slowly?

@zyabin101 I clearly define quality of play it is not a subjective term here

@xnor I give you the option

How is this unclear in any way

@zyabin101 I removed the misleading quality term

Can we take the game state in a format like a dictionary, or should it be a string? Can we assume we're playing X?

@xnor I gave a generous ten seconds per move now

@xnor yes you can choose which side you play and whether or not you move first. Pick a reasonable format.

Let us continue this discussion in chat.

"You win the game if you score and in the process do not score for your opponent." Does this mean that I can only win when I place a piece, not when my opponent does? What happens if a move creates winning lines for both players: game drawn or play on?

@RohanJhunjhunwala You should clarify allowed input of the game state, otherwise it's possible that people may take advantage of the currently undefined input format and choose a format that helps their solution a lot.

You can save 71 bytes by removing items 1 and 3 from the list of criteria

@MarsUltor any format is alllowed

@LuisMendo oh ok. Removing them

@PeterTaylor sorry, your opponent can win it for you.

@Arnauld yes, that position is unreachable. And was for demonstration purpose only

Altered to be more clear

Very good... I would like to know: in minimax function the 2 players have the same code (in the way one maximize positive and the other maximize negative [obtain negative more big])? Or not? Or there are asymmetries? It would be a strange emotion game with a program one wrote that win always who wrote it...

So the eval function should be: Count all tris with their sign (for example -1 for O and +1 for X) if the result is < 0 than win O and stop the game; if it is >0 than win the X and stop the game; otherwise if it is 0, continue the game. I say that because the eval function not has to end when meets the first tris (in the few I understand)

@RosLuP yes, i fthat helps you understand

But one can win in one play (or ply) or in 3 ply or something as that.... Has one to choose the winner move that has less ply? If yes, the board has to be represent at end with 2 number for cell, one can not be sufficient: one if the move win, lost or 0; the other one the deep reachable of that move...

@RosLuP I'm confused. It is ossible to score to obtainmore scores for both players

Perl, 147 bytes (non competing, takes more than 10 seconds per move)
Includes +4 for -0p
The program plays X. It will play a perfect game.
Input the board on STDIN, e.g.:
tictaclatin.pl
-X-O
-X--
X-X-
O--O
^D

The ouptut will be the same board with all X replaced by O and vice versa. The empty spots will be filled with a number indicating the result if X would play there, with 1 meaning the result will be a win, 2 a draw and 3 a loss. A finished game just returns the same position with the colors reversed.
In this example the output would be:
1O1X
1O33
O3O3
X33X

So the position is a win for X if he plays in the 3 spots along the top and the left. All other moves lose.
This confusing output is actually convenient if you want to know how the game continues after a move. Since the program always plays X you have to swap X and O to see the moves for O. Here for example it's pretty clear that X wins by playing in the top left, but what about if X plays in the third position along the top ? Just copy the output, put an O in place of the move you select and replace all other numbers by - again, so here:
-OOX
-O--
O-O-
X--X

Resulting in:
3XXO
3X33
X3X3
O33O

Obviously every move by O should lose, so how does he lose if he plays in the top left ? Again do this by putting O in the top left and replacing the digits by -:
OXXO
-X--
X-X-
O--O

Giving:
XOOX
1O33
O3O3
X33X

So X has only one way to go for his win:
XOOX
OO--
O-O-
X--X

Giving
OXXO
XX33
X3X3
O33O

The situation for O remains hopeless. It's easy to see now that every move allows X to immediately win. Let's at least try to go for 3 O's in a row:
OXXO
XX--
X-X-
O-OO

Giving:
XOOX
OO13
O3O3
X3XX

X plays the only winning move (notice that this makes XXXO along the third column:
XOOX
OOO-
O-O-
X-XX

Here the output is:
OXXO
XXX-
X-X-
O-OO

because the game was already finished. You can see the win on the third column.
The actual program tictaclatin.pl:
#!/usr/bin/perl -0p
y/XO/OX/,$@=-$@while$|-=/(@{[map{(O.".{$_}O"x3)=~s%O%Z|$`X$'|Z%gr}0,3..5]})(?{$@++})^|$/sx;$@<=>0||s%-%$_="$`O$'";$$_||=2+do$0%eg&&(/1/||/2/-1)

Applied to the empty board this evaluates 9506699 positions which takes 30Gb and 41 minutes on my computer. The result is:
2222
2222
2222
2222

So every starting move draws. So the game is a draw.
The extreme memory usage is mostly caused by the recursion using do$0. Using this 154 byte version using a plain function needs 3Gb and 11 minutes:
#!/usr/bin/perl -0p
sub f{y/XO/OX/,$@=-$@while$|-=/(@{[map{(O.".{$_}O"x3)=~s%O%Z|$`X$'|Z%gr}0,3..5]})(?{$@++})^|$/sx;$@<=>0||s%-%$_="$`O$'";$$_||=2+&f%eeg&&(/1/||/2/-1)}f

which is more bearable (but still too much, something must still be leaking memory).
Combining a number of speedups leads to this 160 byte version (5028168 positions, 4 minutes and 800M for the empty board):
#!/usr/bin/perl -0p
sub f{y/XO/OX/,$@=-$@while$|-=/(@{[map{(O.".{$_}O"x3)=~s%O%Z|$`X$'|Z%gr}0,3..5]})(?{$@++})^|$/osx;$@<=>0||s%-%$_="$`O$'";$a{$_}//=&f+1or return 1%eeg&&/1/-1}f

That last one uses 0 for a win (don't confuse with O), 1 for a draw and 2 for a loss. The output of this one is also more confusing. It fills in the winning move for X in case of a win without color swap, but if the input game was already won is still does the color swap and does not fill in any move.
All versions of course get faster and use less memory as the board fills up. The faster versions should generate a move in under 10 seconds as soon as 2 or 3 moves have been made.
In principle this 146 byte version should also work:
#!/usr/bin/perl -0p
y/XO/OX/,$@=-$@while/(@{[map{(O.".{$_}O"x3)=~s%O%Z|$`X$'|Z%gr}0,3..5]})(?{$@++})^/sx,--$|;$@<=>0||s%-%$_="$`O$'";$$_||=2+do$0%eg&&(/1/||/2/-1)

but on my machine it triggers a perl bug and dumps core.
All versions will in principle still work if the 6 byte position caching done by $$_||= is removed but that uses so much time and memory that it only works for almost filled boards. But in theory at least I have a 140 byte solution.
If you put $\= (cost: 3 bytes) just before the $@<=>0 then each output board will be followed by the status of the whole board: 1 for X wins, 0 for draw and -1 for loss.
Here is an interactive driver based on the fastest version mentioned above. The driver has no logic for when the game is finished so you have to stop yourself. The golfed code knows though. If the suggested move returns with no - replaced by anything the game is over.
#!/usr/bin/perl
sub f{
    if ($p++ % 100000 == 0) {
        local $| = 1;
        print ".";
    }
y/XO/OX/,$@=-$@while$|-=/(@{[map{(O.".{$_}O"x3)=~s%O%Z|$`X$'|Z%gr}0,3..5]})(?{$@++})^|$/osx;$@<=>0||s%-%$_="$`O$'";$a{$_}//=&f+1or return 1%eeg&&/1/-1}

# Driver
my $tomove = "X";
my $move = 0;
@board = ("----\n") x 4;
while (1) {
    print "Current board after move $move ($tomove to move):\n  ABCD\n";
    for my $i (1..4) {
        print "$i $board[$i-1]";
    }
    print "Enter a move like B4, PASS (not a valid move, just for setup) or just press enter to let the program make suggestions\n";
    my $input = <> // exit;
    if ($input eq "\n") {
        $_ = join "", @board;
        tr/OX/XO/ if $tomove eq "O";
        $p = 0;
        $@="";
        %a = ();
        my $start = time();
        my $result = f;
        if ($result == 1) {
            tr/OX/XO/ if $tomove eq "O";
            tr/012/-/;
        } else {
            tr/OX/XO/ if $tomove eq "X";
            tr/012/123/;
        }
        $result = -$result if $tomove eq "O";
        my $period = time() - $start;
        print "\nSuggested moves (evaluated $p positions in $period seconds, predicted result for X: $result):\n$_";
        redo;
    } elsif ($input =~ /^pass$/i) {
        # Do nothing
    } elsif (my ($x, $y) = $input =~ /^([A-D])([1-4])$/) {
        $x = ord($x) - ord("A");
        --$y;
        my $ch = substr($board[$y],$x, 1);
        if ($ch ne "-") {
            print "Position already has $ch. Try again\n";
            redo;
        }
        substr($board[$y],$x, 1) = $tomove;
    } else {
        print "Cannot parse move. Try again\n";
        redo;
    }
    $tomove =~ tr/OX/XO/;
    ++$move;
}

NIce answer. Could you provide some easy way for me to test this? Ideally it would love to see an interactive version... (this is jut for my own curiosity).

@RohanJhunjhunwala Ok, added a simple interactive driver

Variable '$move' is not declared
at prog.pl:2

Is there a heuristic solution a human can implement?

@RohanJhunjhunwala Just rechecked the driver program. Runs fine, $move is declared on line 11. I have no idea if there is a human heuristic. This program just does minimax on the game tree, it doesn't have any strategic knowledge.

Huh, ideOne seems borked

tictaclatin.pl
-X-O
-X--
X-X-
O--O
^D
The next to move is O... It seems that x win in every place one put O...

@RosLuP O to move means you should reverse the colors, so give as input -O-X -O-- O-O- X--X. This returns that O wins by playing in the top left. This is correct since it defends the diagonal and is a double threat along the top and along the left.

In linear coordinate 0..15 O in 0, X in 6 (column 3 row 2 beginning to count from 1) than O has to lost for what I see it not win...

Yes I make one error in encode when it win, I thought it was "xxxo" or "ooox" (3 contiguos symbols the same line and one different; instead it was 3 symbols of one type and one of the other type... Excuse I don't know how cancel above comments from my cellphone... Good morning...

I would implemented the evaluation function for for tic tac Latin...for the position pl -X-O -X-- X-X- O--O ^D analysis for the O in response result to me the table -1 3 1 3   1 3 11   3 1 3 1     3 1 1 3 were -1 means win O, 3 means occupied, 1 means win X, 0 mean no win

@RosLuP Yes, that agrees with what my program gives.

It would result The only win for O, it would be the start one, the 0 coordinate all the other ones are all lost moves for O...

If number of X is the same numbers of O: than move X; for me begin always X; for you begin O?  it is for this one would not swap X and O

The number of X's and O's is never used to determine who must move in my program. You always must give the position with X to move. So if it is really O to move you must swap X and O. So for your example the input to my program is -O-X -O-- O-O- X--X. The result 1X3O 3X33 X3X3 O33O, which  agrees with yours (1 is win, 3 is loss)

JavaScript (ES6) 392 bytes
a=>b=>(c="0ed3b56879a4c21f",r=[],k=f=>r.push([a.filter(f),b.filter(f)]),[0,1,2,3].map(i=>k(n=>n%4==i)+k(n=>(n/4|0)==i)),k(n=>n%5==0),k(n=>n&&n-15&&!(n%3)),g=r.find(o=>(o[0].length==1&&o[1].length==2)||(o[0].length==2&&o[1].length==1)),g?parseInt(c[30-[...g[0],...g[1]].map(i=>parseInt(c[i],16)).reduce((p,c)=>p+c)],16):[...a,...b].indexOf(15-a[0])+1?15-a.find(i=>b.indexOf(15-i)==-1):15-a[0])

Usage
The "bot" will play second.
Draw a 4x4 grid which are numbered like this:
+----+----+----+----+
|  0 |  1 |  2 |  3 |
+----+----+----+----+
|  4 |  5 |  6 |  7 |
+----+----+----+----+
|  8 |  9 | 10 | 11 |
+----+----+----+----+
| 12 | 13 | 14 | 15 |
+----+----+----+----+

Let's run this in the browser console: Just put f= before the code
So, if I wanna start at 1, I would run f([1])([]) and it will give me 14.
Nice move... What if I play 2 afterwards? f([2,1])([14]).  It will return 13.
Lemme try surrendering. Play 3. f([3,2,1])([14,13]).  Oh 0! You got me!
Play 0? f([0,2,1])([14,13]). 15 Ok let's keep playing...
Note

Play interactively.  Start with f([your-step])([]).
Prepend your next step. (See demo above)
Help the "bot" input its steps.  It will not give you good results if you give it a random setting. (Like f([1,2,4])([14,12]) will give 14 - Hey the bot wanted to play on 13 on its second move!

Brief Summary
As long as you are not surrendering, the bot will play a mirror move.
Thanks @EHTproductions for telling me that I misread the game rules and golfing tips :P
Now it will also detect if it got checkmate.  If yes, block it!
Its priorities: Block > Mirror > (fallback) look for ways to reproducing a mirror

I really like the "mirror move" tactic :) I may be misunderstanding, but isn't 3,2,1 for you and 0 for the bot a win for you?

Oops, I misunderstood as "who captures a pattern of 3 of a kind and 1 of another".  Lemme tweak the solution a bit.. Thanks @ETHproductions.

A couple of golfing tips: [0,1,2,3].map(i=>{k(n=>n%4==i);k(n=>Math.floor(n/4)==i);}) can be golfed to [0,1,2,3].map(i=>k(n=>n%4==i)+k(n=>(n/4|0)==i)).

I don't think this is provably winnable

0 - 14 - 12 -13 cracks it

@RohanJhunjhunwala Oh you're right... My answer is only a little bit better than while(a=prompt())alert(15-a)... Lemme try thinking of a better strategy other than "smelling for surrender"

Can this lose? I don't know how to really test this

Sadly no - Just played with it and a sequence of me playing 0, 11, 14, 3 will create double checkmate. Gotta fix it later...


text:
Shortest way to strip the commas from column n given a .csv file/input
Ok, so the input here is going to be a .csv file and so is the output. Now, given a .csv file/input like so
"apple","banana","apple,banana","orange"
"grape","orange","grape,orange","sprout"
# 0       1        2              3

strip out all commas for a given nth column's entries (index starts at 0). So, for the input above, the program would output a .csv file like so for n = 2:
"apple","banana","applebanana","orange"
"grape","orange","grapeorange","sprout"

If the particular column's entries do not have commas, then it does nothing. Could have any allowable/manageable number of columns, and if you somehow find that creating a program that takes more than one argument, say, a, b, c, ..., z like this
program(a=1,b=4,c=65, ..., z=0, mycsv.csv)

for respective columns 2, 5, and 66, which all strip out commas for each, to be shorter, then do that.

Shortest code measured in bytes wins, and it doesn't have to be a file that is output/input.

Are double quotes allowed in a field? If yes, how are they escaped?

This feels like a homework challenge under the guise of code-golf

How can we accept the file as input? string array? file name? whatever suits us?

Please clarify which characters can appear in the input fields. A test case that has commas outside the column we have to modify would also be helpful.

Does it has to be zero based? E.g. If the language or approach is 1-based?

05AB1E, 27 bytes
U|vy“","“©¡vyNXQi","-}})®ý,

Explanation
U                           # store index in X
 |v                         # for each line
   y“","“©¡                 # split on ","
           v          }     # for each in the split list
            yNXQi","-}      # if it's index equals X, remove any commas
                       )    # wrap in list
                        ®ý, # merge on "," and print

Try it online!

JavaScript (ES6), 95 93 90 bytes
Takes the content of the CSV file as its first parameter and the column index as its second parameter, with currying syntax.

let f =

s=>n=>s.split(/("[^"]*")/).map(c=>(c<' '?(k=0,c):k++-n*2?c:c.split`,`.join``),k=-1).join``

console.log(f(
`"apple","banana","apple,banana","orange"
"grape","orange","grape,orange","sprout"
`)(2));

The question says it must take a file as input.

@DanTheMan - This is apparently not required anymore.

Are the s= and the parens in the regex necessary?

@ETHproductions - My bad. The s= was left from a previous attempt. Thanks for noticing. I don't think I can get rid of the parens in the split, though.

Oh, I didn't realize that you could capture groups in the split argument! That's a cool feature.

Ruby, 80 bytes
require'csv'
->n,x{CSV.read(x).map{|a|a[n].delete!',';a.to_csv(force_quotes:1)}}

A lambda that takes n and a file path argument, and returns a list of CSV rows.

Would .tr!?,,'' work?

Python 2, 129 126 125 98 96 94 92 bytes
lambda n,f:''.join(c*((r[:i].count('"')-n*2)*','!=c)for r in open(f)for i,c in enumerate(r))

This is a lambda expression; to use it, prefix lambda with s=.
Iterates through each character of each line, filtering characters based on whether it's a comma and it's in a double-quoted string.
Now doesn't use the csv module at all!
Example run:
>>> s=lambda n,f:''.join(c*((r[:i].count('"')-n*2)*','!=c)for r in open(f)for i,c in enumerate(r))
>>> print s(2, 'test.csv')
"apple","banana","applebanana","orange"
"grape","orange","grapeorange","sprout"

Sh + GNU Sed GNU Sed, 36 28 + 1 bytes
Run with -r flag.
sed -r 's/(,?"\w*),?(\w*")/\1\2/'$1

One argument to select proper column (1-indexed). This uses a GNU-specific sed extension.

Old version: s/(,?\"\w*),?(\w*\")/\1\2/3
This required replacing the last 3 to select the proper column (1-indexed), which I'm not sure is allowed.

The question's test case is rather poor, but it says “strip out all commas for a given nth column's entries”, that sounds like each column may contain multiple commas. I'm afraid your solution is not handling them: http://pastebin.com/N3YrfMUN

NodeJS, 129 bytes
(f,n)=>(require("fs").readFileSync(f)+"").split`
`.map(a=>a.match(/".*?"/g).map((b,i)=>i-n?b:b.replace(/,/g,"")).join`,`).join`
`

Defines an anonymous function that takes a file path and a number as input. It is no longer required to take input as a file, but I will leave this here for comparison.

Vim, 32 keystrokes (excluding column index)
This uses 1-based column indices (which might make this answer invalid).
The problem here is that Vim does not start from the current character but rather from the following one... So it's not "easy" to match the 1st set of quotes. Instead, it finds the closing quotes and selects backwards.
Solution
qq + the column index + /\v"(,"|$)<cr>vF":s/\%V,//<cr><cr>@qq@q
Explanation

qq starts recording macro q
/\v"(,"|$)<cr> searches for the next ending quote or end if line. Preceded by the input column number, it finds the nth occurrence
vF" visually selects the previous quote
":s/\%V,//<cr> substitutes in the visual selection (\%V) every comma by nothing
<cr> goes to the next line
@qq@q makes the macro recursive, stops it and then play it until the end of the file.

Gotchas

If a column only contains commas, it will be detected as a column end and will break. This is a gray zone, I will adapt the answer is the question adds this to the test cases.

Haskell, 56 bytes
n!x=Math.FFT.Base.adjust(filter(/=','))n.read$'[':x++"]"

Without adjust you'd have to do something crazy like this:
n#(a,b)|a==n|filter(/=',')b|1<2=b; .. (n#)=<<zip ..

R, 59 bytes
 function(f,n){x=read.csv(f,h=0);x[,n]=gsub(",","",x[,n]);x}

A simple function that takes f, the location of the csv file, and n, the column number to replace. Reads in the file, removes all commas from the nth column, returns the resulting data frame. R indexes from 1, not from 0.

PHP, 81 bytes
while($r=fgetcsv(STDIN)){$r[$n=argv[1]]=strtr($r[$n],",","");fputcsv(STDOUT,$r);}

Run with php -r '<code>' <n> < <csvsource> > <csvtarget>.

source: Stack Exchange

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

sort: votes


text:
Draw a Bumpy String
(Inspired by this challenge.)
Let's say we have a string ABBCBA. We can say that there is a rise between A and B, for B follows A; we can say that there is a run between B and B, for nothing changes; and finally we can say there is a fall between C and B. We can draw a graph like this:
             A   B   B   C   B   A
Rising:        o       o
Continuing:        o
Falling:                   o   o

Without the labels, and minimizing whitespace:
o o
 o
   oo

This is the expected output for input ABBCBA.
You may use any non-whitespace character to replace o in the output. Further, each column may optionally have an extra space between them, like so:
o   o
  o
      o o

The input will consist of at least three characters. The string will consist entirely of uppercase letters, but you may instead use lowercase letters.
Test cases
TEST CASE
LINE 1
LINE 2
LINE 3

HELLOWORLD
 o oo o
  o
o    o oo

TESTCASE
 oo  o

o  oo o

EXAMINATION
o o o o o

 o o o o o

ZSILENTYOUTH
  o ooo o

oo o   o oo

ABC
oo

ABCBA
oo

  oo

Could there be a space between each consecutive os, or does the output have to be compact?

@JHM Sure, that's fine.

Also, does the output have to be a string, or does it only need to look similar to the example?

@JHM What do you ahve in mind?

The code I have in mind generates a grid.

@JHM A grid? Could you give me an example?

The output looks identical to the requirement, but copy/pasting it gives a list.

@Arnauld no, it is not.

@JHM I only care about the output.

May we output a list of three strings?

@xnor I suppose, yeah.

May I replace space with any other character for when it's not a rise/run/fall?

Jelly, 11 bytes
OIṠ“ o ”ṙZY

Try it online! or verify all test cases.
How it works
OIṠ“ o ”ṙZY  Main link. Argument: s (string)

O            Ordinal; replace all characters with their code points.
 I           Increments; compute the differences of consecutive code points.
  Ṡ          Sign function.
   “ o ”ṙ    Rotate that string -1, 0, or 1 unit(s) to the left.
         Z   Zip; transpose rows and columns.
          Y  Join, separating by linefeeds.

Mathematica, 93 83 68 64 bytes
(uses 0, not O)
Row[Column@Insert[{,},0,2-#]&/@Sign@Differences@LetterNumber@#]&

Explanation
LetterNumber@#

Gets the position in the alphabet of each characters of the input.
Sign@Differences@

Takes the difference between each consecutive elements, and takes the sign (-1 for negative/falling, 0 for 0/continuing, 1 for positive/rising)
Insert[{,},0,2-#]&

Inserts a 0 in a list of two Nulls, in the first position if rising, middle if continuing, and third position if falling.
Row[Column@ ... ]

Formats the output.

If the output could look different from the one in the question, the above code could be shortened to 41 bytes:
ListPlot@*Sign@*Differences@*LetterNumber

... which creates something like this (for "ABBCBA"):

How does the 41 byte look?

@ConorO'Brien please see edit.

MATL, 15, 14 bytes
dZSqtQtQv~79*c

Try it online!
Explanation:
They say a picture is worth a thousand words, so here is a beta online interpreter that shows you the value on top of the stack live as it updates. Note that it's still in beta, so you might need to hit run several times.
So first, we call dZS. d gives us the difference between each consecutive element, and ZS gives us the sign (-1, 0, or 1) of each element. So with 'HELLOWORLD' as input, after the first step we'll have:
-1  1  0  1  1 -1  1 -1 -1

Now, we just use q to decrement this and get:
-2  0 -1  0  0 -2  0 -2 -2

And then two times we duplicate the top of the stack and increment the array (tQ) After this we'll have
-2  0 -1  0  0 -2  0 -2 -2
-1  1  0  1  1 -1  1 -1 -1
0   2  1  2  2  0  2  0  0

Now all of the '0's are where we want to output a character. So, we join these three arrays into a matrix (v), and logically negate it (~). Then we multiply every value in the matrix by the ASCII value of 'O', (79*) and display it as a string with c.

Once you have the vector [-1, 1, 0, 1,...], you could use them as the row indices of a sparse matrix with column indices [1,2,3,4,...], then convert it to a full matrix.

OK nevermind, tried that suggestion, doesn't seem to save anything

@NickAlger Thanks for the tip anyway! Out of curiosity, could I see what you came up with?

Sure. The following is 19 chars, though it could probably be improved a few, dZS2+tn:tnZ?XPg79*c

Got it to 16 with a couple optimizations, dZSqq_tn:lZ?79*c

@NickAlger Oh nice! Another byte to take off: the output character is arbitrary, so you could just do 9*c instead of 79*c. You should post that as another answer (even though it's a tad longer)

For some reason it doesn't seem to work with just 9*c

@NickAlger Oh, sorry about that. I tested that on your previous version, not the new one.

Ok, wrote it up in another answer here: http://codegolf.stackexchange.com/a/94452/42247

Haskell, 63 bytes
f w=[do(e,y)<-zip w$tail w;max" "['o'|b e y]|b<-[(<),(==),(>)]]

Returns a list of three strings, representing the lines of output. Contains no subliminal messages.
dianne saved three bytes by using do notation and max instead of a list comprehension and last.

Great, it contains no subliminal messages! What are those?

['o'|b e y]..

Yes, my master Wait what's going on?

I found the secret word obey. Lol!

CJam, 19 bytes
l2ew{:-g)S3*0t}%zN*

Uses 0 instead of o.
Try it online!
Explanation
l      e# Read input.
2ew    e# Get all pairs of consecutive letters.
{      e# Map this block over the pairs...
  :-   e#   Compute the difference between the two letters.
  g    e#   Signum. Gives -1 for rises, 1 for falls, 0 otherwise.
  )    e#   Increment. Gives 0 for rises, 2 for falls, 1 otherwise. Call this i.
  S3*  e#   Push a string with three spaces.
  0t   e#   Replace the i'th space (zero-based) with a zero.
}%
z      e# Transpose.
N*     e# Join with linefeeds.

JavaScript (ES6), 96 95 89 87 82 bytes
2 bytes saved by using 0 instead of o, as suggested by Conor O'Brien
2 6 bytes saved thanks to ETHproductions

let f =

s=>[1,0,-1].map(k=>s.replace(/./g,(c,i)=>i--?(c>s[i])-(c<s[i])-k&&' ':'')).join`
`

console.log(f("HELLOWORLD"));
console.log(f("EXAMINATION"));

Since you can use any character, does replacing 'o' with 0 help any?

@ConorO'Brien - Indeed, it does. ;)

I think s=>[1,0,-1].map(k=>[...s].map(c=>(r=p?(c>p)-(c<p)-k&&' ':'',p=c,r),p=0).join``).join`\n`  would work, saving 2 bytes.

You can save another byte by grabbing the previous character each time instead of manually keeping track of it: s=>[1,0,-1].map(k=>[...s].map((c,i)=>(p=s[i-1])?(c>p)-(c<p)-k&&' ':'').join``).join`\n` . s.replace will also save you several bytes over [...s].map().join().

Python 2, 76 71 bytes
lambda s:[''.join(' o'[cmp(*x)==n]for x in zip(s,s[1:]))for n in-1,0,1]

Thanks to @xnor for notifying me that returning a list of strings is allowed.
Test it on Ideone.

You're allowed to output a list of three strings, which lets you do a lambda.

I am? That changes everything.

I asked in the comments because Lynn's Haskell answer was doing it.

MATL, 16 14 Bytes
dZSqq_tn:79Z?c

Try it online!
This grew out of a discussion of DJMCMahem's answer. Even though this answer is 2 characters longer the same length, the method is somewhat different so it may be of independent interest.
Thanks to Luis Mendo for a suggestion saving 2 bytes (see comments)
Explanation:
'dZS' gets a vector where each entry is the sign of the differences between sucessive characters, then 'qq_' decrements each entry by two and flips the sign, so now if the character increases it is 1, if it stays the same 2, and if it decreases 3. For example,
dZSqq_ applied to 'HELLOWORLD' creates the vector [3 1 2 1 1 3 1 3 3]

Next, 't' makes a copy of the previous vector on the stack, then 'n:' places the vector [1,2,3,4,...] on the stack as well. Then '79' places the value 79 on the stack. The value 79 is chosen because it is the number for the unicode character 'o', which will be our output later. (Thanks to Luis Mendo for the idea to put the value 79 here rather than later)
tn:79 applied to [3 1 2 1 1 3 1 3 3] creates the following items:
[3 1 2 1 1 3 1 3 3]   <-- first item on the stack
[1 2 3 4 5 6 7 8 9]   <-- second item on the stack
79                    <-- third item on the stack

At this point we have precisely the row indices, column indices, and nonzero value of a sparse matrix that has the value 79 wherever we want the output character, and 0 wherever we want to output whitespace. We take these three items off the stack and create this sparse matrix with MATL's sparse matrix command 'Z?'. That is,
dZSqq_tn:79 Z? applied to 'HELLOWORLD' outputs the following:
[0  79 0  79 79 0  79 0  0 ]
[0  0  79 0  0  0  0  0  0 ]   <-- 3-by-n sparse matrix
[79 0  0  0  0  79 0  79 79]

All that is left is to convert the matrix from numbers to unicode characters, which is done by the command 'c'. The 79's become 'o', and the 0's become spaces:
dZSqq_tn:79Z?c applied to 'HELLOWORLD' outputs:
[  o   o o   o    ]
[    o            ]   <-- 3-by-n sparse matrix of characters.
[o         o   o o]

The resulting matrix of chars is then implicitly displayed.

You can directly use 79 as the nonzero value for the sparse matrix, thus saving two bytes. Also, I think this is the first time that sparse matrices are used in a MATL answer :-)

@LuisMendo Thanks! I edited the post to make the change you suggest

Perl, 47 bytes
Includes +1 for -p
Give input on STDIN:
bumpy.pl <<< ABBCBA

bumpy.pl:
#!/usr/bin/perl -p
$_ x=3;s%.%/\G(.)(.)/?$2cmp$1^$.&&$":--$.>0%eg

PHP, 95 Bytes
for($b[1]=$b[0]=$b[-1]=" ";($s=$argv[1])[++$i];)$b[$s[$i-1]<=>$s[$i]][$i]=8;echo join("\n",$b);

1.Create an array of strings with the index -1 to 1 alternative $b=array_fill(-1,3," ");
2.Fill the strings dependent by the spaceship operator and position of the input
3.Output join the array with a new line
First Way 111 Bytes
for($o=" ";$i<$l=strlen($s=$argv[1])-1;)$o[$l*(1+($s[$i]<=>$s[$i+1]))+$i++]=8;echo join("\n",str_split($o,$l));

Use the spaceship operator <=> spaceship operator

If you encode your program in Latin-1, ~õ is a handy shortcut for "\n". No, seriously!

Same thing for " ", which can be ~ß. Example. You want to set your browser encoding to Latin-1 when viewing these.

@Lynn or ~³~†~‘~‘ Thank You for the idea. I will prefer unicode

Java 7, 158 156 bytes
String c(char[]z){String a,b,c=a=b="";for(char i=1,q=z[0],o=79,s=32,x;i<z.length;a+=(x=z[i])>q?o:s,b+=x==q?o:s,c+=x<q?o:s,q=z[i++]);return a+"\n"+b+"\n"+c;}

2 bytes saved thanks to @Frozn.
Ungolfed & test cases:
Try it here.
class M{
  static String c(char[] z){
    String a,
           b,
           c = a = b = "";
    for(char i = 1,
             q = z[0],
             o = 79,
             s = 32,
             x; i < z.length; a += (x = z[i]) > q
                                     ? o
                                     : s,
                              b += x == q
                                     ? o
                                     : s,
                              c += x < q
                                     ? o
                                     : s,
                              q = z[i++]);
    return a + "\n" + b + "\n" + c;
  }

  public static void main(String[] a){
    print("HELLOWORLD");
    print("TESTCASE");
    print("EXAMINATION");
    print("ZSILENTYOUTH");
    print("ABC");
    print("ABCBA");
    print("ABBCBA");
    print("UVVWVVUVVWVVUVVW");
  }

  static void print(String s){
    System.out.println(c(s.toCharArray()));
    System.out.println("-------------------------");
  }
}

Output:
 O OO O
  O
O    O OO
-------------------------
 OO  O

O  OO O
-------------------------
O O O O O

 O O O O O
-------------------------
  O OOO O

OO O   O OO
-------------------------
OO

-------------------------
OO

  OO
-------------------------
O O
 O
   OO
-------------------------
O O   O O   O O
 O  O  O  O  O
   O O   O O
-------------------------

I'm not sure whether this works but a,b,c=b=a="" would be shorter.

@Frozn Thanks, edited. It indeed works. PS: you could have checked yourself in the ideone by forking it. ;)

You're right! I'm always overlooking the links and starting up eclipse just for that isn't worth it :)

JavaScript (ES6), 81 bytes
s=>[s,s,s].map(f=([c,...s],n)=>(p=s[0])?((c<p)-(c>p)+n-1&&" ")+f(s,n):"").join`
`

Written from scratch, though it was heavily inspired by @Arnauld's answer. Uses recursion to calculate the contents of each row.

Ruby, 66 64 bytes
->s{(-1..1).map{|n|s.gsub(/.(?=(.))/){"o  "[n+($1<=>$&)]}.chop}}

See it on eval.in: https://eval.in/649503

Clora (20 bytes)
<IN?o ;=IN?o ;>IN?o
Explanation:
There are 3 Clora programs, one for each output line.
First program, <IN?o
Check if current input char I is smaller < than the next char N. Save the result in a global flag. Check the flag result ? and if is true, output o, else a blank space (yes, there is a blank space there.
All other programs, follow the same rule and are separated by ;, every program is executed and receives the input as argument.
You can test it by yourself including clora.js and executing it with
(function() {
  var x = new Clora('<IN?o ;=IN?o ;>IN?o ');
  x.execute('EXAMINATION', function(r) {
    console.log(r)
  })
})();

Pyth, 21 bytes
jCmX*3\ h._d0-M.:CMz2

A program that takes input of an unquoted string on STDIN and prints the result.
This uses a similar idea to @MartinEnder's CJam answer.
Try it online or Verify all test cases.
How it works
jCmX*3\ h._d0-M.:CMz2  Program. Input: z
                 CMz   Map ordinal over z, yielding the code-points of the characters
               .:   2  Yield all length-2 sublists of that
             -M        Map subtraction over that
  m                    Map the following over that with variable d:
         ._d            Yield the sign of d
        h               Increment that (i)
    *3\                 Yield string literal of 3 spaces, "   "
   X        0           Replace the space at index i with 0
 C                     Transpose that
j                      Join that on newlines
                       Implicitly print

PHP 7, 81 80 77 bytes
Note: uses Windows-1252 encoding
for($x=2;~$x--;print~õ)for($a=$argn;$c=$a[$$x+1];)echo$c<=>$a[$$x++]^$x?~ß:o;

Run like this:
echo HELLOWORLD | php -nR 'for($x=2;~$x--;print"\n")for($a=$argn;$c=$a[$$x+1];)echo$c<=>$a[$$x++]^$x?" ":o;';echo

Explanation
Iterates over lines (numbered 1, 0, -1). Then iterates over the input string for every line. When the result of spaceship comparison equals the line number, output an o, otherwise, output a space. After every line, print a newline.
Tweaks

Stop iterating when $x is -1, which we can find by binary negation (result 0). Saves a byte compared to adding 1 (or 2 with pre-increment).
Saved 3 bytes by using $argn

You forgot to add -d error_reporting=30709 to your byte count.

@Titus Why in the world would I need to add that to the byte count? It's only so PHP Notices (which are ignorable) are not printed!

Could also add 2>/dev/null, but that will get rid of ALL errors, including fatal

Oh, and a reference

Something like If you get warnings, set the default value with .... Please excuse my pedantery; I didn´t decode that value.

Lua 326 303 bytes
    tl=0 s=io.read() o1,o2,o3="","","" t={} for i=1,#s do t[i]=s:sub(i,i) tl=tl+1 end for v=1,tl-1 do if t[v]t[v+1] then o1=o1.." " o2=o2.." " o3=o3.."o" end end print(o1.."\n"..o2.."\n"..o3)
An ungolfed version
tl = 0 --set the tables length to 0
s = io.read() --Get the string from input
o1,o2,o3="","","" --Set the 3 output rows to empty strings
t = {} --Make a table for the string to be sent into
for i = 1, #s do --Loop from 1 to the length of the string
    t[i] = s:sub(i, i) --Set the I-th term in the table to the I-th character in the string
    tl = tl+1 --Add 1 to the table length
end --End the loop
for v=1,tl-1, 1 do --Loop from 1 to the tables length - 1, incrementing by 1
    if t[v] < t[v+1] then --Lua supports greater than less than and equals to with charactes, so this if statement detects if the string is rising
        o1=o1.."o" --Adds an o to the end of the first line of output
        o2=o2.." " --Adds a space to the second line
        o3=o3.." " --Adds a space to the third line
    elseif t[v] == t[v+1] then --Detects if the string is continuing
        o1=o1.." " --Adds a space to the first line
        o2=o2.."o" --Adds an o to the second line
        o3=o3.." " --Adds a space to the third line
    elseif t[v] > t[v+1] then --Detects if string is falling
        o1=o1.." " --Adds a space to the first line
        o2=o2.." " --Adds a space to the second line
        o3=o3.."o" --Adds an o to the third line
    end --Ends the if statement
end --Ends the loop
print(o1.."\n"..o2.."\n"..o3) --Prints the output

I think you can golf out some whitespace from, say, t1 = 0? to t1=0? And similar places.

I will fix that now

R, 114 bytes
A non-competing R answer.
v=y=z=rep(" ",length(x<-diff(utf8ToInt(scan(,"")))));v[x>0]="#";y[x==0]="#";z[x<0]="#";cat(v,"\n",y,"\n",z,sep="")

Explanation

Read input from command line and convert into ascii decimal vector
Take 1st difference and create an 3x vectors of the same length with white spaces
Then replace the white space vectors with # if the differences are >0, ==0 or <0.
Coerce the vectors and print them separated by newlines

Why noncompeting?

@ConorO'Brien I guess it's competing against other R answers but the original solution was way to long and not unique enough to be interesting in the general sense.

Japt -R, 13 bytes
Takes input as a character array. The first 3 bytes could be removed by taking input as an array of codepoints. Uses " instead of o.
mc äÎm!éQû3)Õ

Try it

Vyxal, 8 bytes
C¯±››×↲§

Try it Online!
The power of that one built-in I added 3 years ago because I thought it was a good idea to have something to vertically join a list of lists. Can be 7 bytes with the L flag.
Explained
C¯±››×↲§
C¯        # Convert each character to ascii value and get pairwise differences
  ±       # Sign of each
   ››     # + 2 (the ⇧ element doesn't vectorise it's numeric overload)
     ×↲   # left adjust the string "*" by each number in ^
       §  # "vertical join" - Transpose (filling with spaces) and then join on newlines

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

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


text:
Tips for golfing in S.I.L.O.S
What general tips do you have for golfing in S.I.L.O.S? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to S.I.L.O.S (e.g. "remove comments" is not an answer).
Please post one tip per answer.
S.I.L.O.S can be run here.

Abuse the preprocessor
All SILOS programs can optionally have a macro statement on the second line
Consider the following program... One of my favorite SILOS submissions by betseg.

a=97
def q print z bottle v beer L Line g wall x IntNoLine h the c around
qL 99 zs of v on h g, 99 zs of v.
lbls
q Take one down and pass it c,
a+1
qx a
qL  zs of v on h g.
qx a
q  zs of v on h g,
qx a
qL  zs of v.
a-2
if a s
qL Take one down and pass it c, 1 z of v on h g.
qL 1 z of v on h g, 1 z of v.
q Go to h store and buy some more, 99 zs of v on h g.

Look at that savings
Try it out!

Never sometimes divide by 0.
Consider a challege where we should output the input if it is not 0 and output -1 otherwise. We could do the following.
S.I.L.O.S, 50 bytes
readIO
if i b
print -1
GOTO c
lblb
printInt i
lblc

Try it online!
However, that is far from optimal. The "superior" solution would be this.
S.I.L.O.S, 33 bytes
readIO
j=i
i/i
j=j+i-1
printInt j

Try it online!
SILOS will quietly ignore the division by 0, which results in a no-op.

Never declare variables
There is no need to declare a variable. All variables are automatgically initialized to 0.

Hence, this-

a=0
a=97
printInt a

Is the same as this

a=97
printInt a


text:
Cheating a multiple choice test, part 2
This is sequel to this challenge by Adnan. If you like this challenge, chances are you'll like the other one too. Check it out!

A multiple choice test with 8 questions each with 4 choices might have the answers: BCADBADA. Converted to four different arrays, with true and false if the current letter is the answer, it will look like this
Q#: 1  2  3  4  5  6  7  8
    B  C  A  D  B  A  D  A
A: [0, 0, 1, 0, 0, 1, 0, 1]
B: [1, 0, 0, 0, 1, 0, 0, 0]
C: [0, 1, 0, 0, 0, 0, 0, 0]
D: [0, 0, 0, 1, 0, 0, 1, 0]

This can be compressed using a bit of logic. Each of the choices A, B, C and D can be represented
by two true/false values shown below:
A: 1 0
B: 0 1
C: 0 0
D: 1 1

Using this logic, we can compress the four vectors above to just two:
 1  2  3  4  5  6  7  8
 B  C  A  D  B  A  D  A
[0, 0, 1, 1, 0, 1, 1, 1]
[1, 0, 0, 1, 1, 0, 1, 0]

That is, the solution to your test is simply: 00110111, 10011010. By concatenating these, we get the binary number
0011011110011010, or 14234 in decimal. Use this decimal value to cheat on your test!
Challenge
Take a number N in the (inclusive) range [0, 65535], and output a string with the answer to the multiple choice test.
Test cases:
14234
BCADBADA

38513
ABBDCAAB

0
CCCCCCCC

120
CBBBBCCC

65535
DDDDDDDD

39253
ABCDABCD

The output may be in upper or lower case letters, but you can not use other symbols.

Does the output have to be the string as shown, or can the letters be on separate lines, in a list, etc?

@xnor Optional    :-)

Why not the obvious A=00,B=01,C=10,D=11?

The reason was I first made A=10, B=01, then C=nor(A,B), and D=and(A,B), inspired by Adnan's challenge. In hindsight it might have been better to do it the other way around, but well... Too late now...

Jelly, 14 bytes
d⁹+⁹BZḄḊị“BADC

Try it online! or verify all test cases.
How it works
d⁹+⁹BZḄḊị“BADC  Main link. Argument: n

d⁹              Divmod 256; yield [n : 256, n % 256].
  +⁹            Add 256; yield [n : 256 + 256, n % 256 + 256].
    B           Binary; convert both integers to base 2.
     Z          Zip; group the quotient bits with corresponding remainder bits.
      Ḅ         Unbinary; convert from base 2 to integer.
       Ḋ        Dequeue; discard the first integer, which corresponds to the
                dummy value introduced by adding 256 to quotient and remainder.
        ị“BADC  Index into that string, mapping [1, 2, 3, 0] to "BADC".

05AB1E, 19 18 16 bytes
Code:
žH+b¦2äøC’c‰±’sè

Uses the CP-1252 encoding. Try it online!
Explanation:
First, we add 65536 to the number (žH is a constant defined to 65536), which is also 10000000000000000 in binary. This is to pad the number with zeroes. Let's take the number 14234 as an example. 14234 + 65536 is equal to 79770. Which in binary is:
10011011110011010

We remove the first character, resulting in:
0011011110011010

We split the string into two pieces using 2ä:
00110111, 10011010

After that, we zip the array with ø:
01, 00, 10, 11, 01, 10, 11, 10

Converting them back into decimal (using C) results in:
1, 0, 2, 3, 1, 2, 3, 2

Now, we only need to index it with the string cbad. The compressed version for this string is ’c‰±’, which can also be tested here. Finally, we get the characters at the index of the above array. For the above example, this results in:
1, 0, 2, 3, 1, 2, 3, 2
b  c  a  d  b  a  d  a

JavaScript (ES6), 55 48 bytes

f=(n,i=8)=>i--?"CBAD"[n>>i&1|n>>i+7&2]+f(n,i):''

console.log(f(14234)); // BCADBADA
console.log(f(38513)); // ABBDCAAB
console.log(f(0));     // CCCCCCCC
console.log(f(120));   // CBBBBCCC
console.log(f(65535)); // DDDDDDDD
console.log(f(39253)); // ABCDABCD

Non-recursive version (55 bytes)
Using a regular expression, we can do:
n=>"76543210".replace(/./g,i=>"CBAD"[n>>i&1|n>>+i+7&2])

How did you think of doing the bitwise operations?

@ericw31415 - Even if it's not doing so explicitly, the challenge is actually describing these bitwise operations in reverse order (starting at "This can be compressed using a bit of logic.")

...a bit of logic...

Python 2, 53 bytes
f=lambda n,k=8:k*'_'and f(n/2,k-1)+'CBAD'[n>>7&2|n&1]

Test it on Ideone.

I was trying to use (n&257)%127 but it's longer. Too bad 127 is prime. Maybe you can think of a way to optimize it.

CP-1610 assembly, 24 DECLEs (30 bytes)
This code is intended to be run on an Intellivision. (1)
A CP-1610 opcode is encoded with a 10-bit value, known as a 'DECLE'. The actual function is 24 DECLEs long, starting at $4809 and ending at $4820.
The CPU registers are however 16-bit wide, so it will support any input value in 0x0000 .. 0xFFFF.
                            ROMW  10            ; use 10-bit ROM
                            ORG   $4800         ; start program at address $4800
4800 0002                   EIS                 ; enable interrupts (to enable display)

                    ;; ---- usage example
4801 0001                   SDBD                ; load parameter in R0
4802 02B8 009A 0037         MVII  #14234, R0    ;
4805 0004 0148 0009         CALL  cheat         ; call function
4808 0017                   DECR  PC            ; infinite loop

                    ;; ---- 'Cheat Your Test' function
                    cheat   PROC

4809 0082                   MOVR  R0,     R2    ; copy R0 to R2
480A 0040                   SWAP  R0            ; swap LSB/MSB in R0
480B 02BC 0214              MVII  #$214,  R4    ; R4 = pointer to 2nd row of screen memory

480D 01DB           @@loop  CLRR  R3            ; clear R3
480E 0052                   RLC   R2            ; extract highest bit of R2 to carry
480F 0053                   RLC   R3            ; inject carry into R3
4810 0050                   RLC   R0            ; extract highest bit of R0 to carry
4811 0053                   RLC   R3            ; inject carry into R3
4812 0001                   SDBD                ; add pointer to lookup table to R3
4813 02FB 001D 0048         ADDI  #@@tbl, R3    ;
4816 029B                   MVI@  R3,     R3    ; read character value
4817 0263                   MVO@  R3,     R4    ; write it to screen memory (also does R4++)
4818 037C 021C              CMPI  #$21C,  R4    ; 8 characters written? ...
481A 0225 000E              BLT   @@loop        ; ... if not, jump to @@loop

481C 00AF                   JR    R5            ; return

481D 011F 0117      @@tbl   DECLE $11F, $117    ; characters 'B', 'C', 'A' and 'D'
481F 010F 0127              DECLE $10F, $127    ; in white, using the built-in font

                            ENDP

Output

(1) Granted that at least one compiler, several emulators and copyright-free replacement ROM files are freely available, I think that it doesn't infringe any PPCG submission rule. But please let me know if I'm wrong.

We score in bytes, so add up the total number of bits, and your score is the decimal (float) result of dividing that value by eight. In this case, 27.5 bytes.

PHP, 57 Bytes
for($i=8;$i--;)echo CBAD[($n=$argv[1])>>$i+7&2|$n>>$i&1];

Version without Bitwise operators 70 Bytes
for(;$i<8;)echo CABD[($s=sprintf("%016b",$argv[1]))[$i]+$s[8+$i++]*2];

Where is variable $i defined?

@ericw31415 In the first use of a variable is initialized and automatically declared PHP this variable with a null reference

That's PHP (tm)

Mathematica, 75 73 68 66 bytes
StringPart["CBAD",#+##+1]&@@IntegerDigits[#,2,16]~Partition~8<>""&

Thanks to @MartinEnder for saving 2 bytes.

@MartinEnder #+## and Infix work, but using StringPart is inevitable because the head of "C"["B","A","D"][[#+##]] is "C", not List; StringJoin doesn't work.

Oh, I didn't realise that # and #2 were the entire lists.

JavaScript, 113 93 90 88 bytes
A big thanks to @Neil for helping me save 20 bytes!
-3 bytes thanks to @Cyoce

n=>{r="";b=("0".repeat(15)+n.toString(2)).slice(-16);for(i=0;i<8;i++)r+="CBAD"[parseInt(b[i]+b[i+8],2)];return r}

n=>{r="";b=(65536+n).toString(2).slice(1);for(i=0;i<8;i++)r+="CBAD"[+b[i+8]+2*b[i]];return r}

n=>eval('r="";b=(65536+n).toString(2).slice(1);for(i=0;i<8;i++)r+="CBAD"[+b[i+8]+2*b[i]]')

n=>eval('r="";b=n.toString(2).padStart(16,0);for(i=0;i<8;i++)r+="CBAD"[+b[i+8]+2*b[i]]')

Sadly, JavaScript lacks functions like decbin, bindec, and str_pad that PHP has.

(65536+n).toString(2).slice(1) and [+b[i+8]+2*b[i]] would be shorter, for example.

padStart, should it be accepted into a future version of ECMAscript, would result in a bigger saving.

Instead of {…;return }, use eval("…")

@Neil It seems that padStart now exists in ECMAScript.

CJam, 22 bytes
ri2bG0e[8/:.{1$=)^'A+}

Try it online!
Explanation
Powered by magic...
The mapping of bit pairs to letters in this challenge is a bit arbitrary. If we represent ABCD by 0, 1, 2, 3 (so we can just add them to the character A) then we want the following mapping:
i1   i2   o
0    0    2
0    1    1
1    0    0
1    1    3

This mapping can be computed with a magical little formula: ((i1 == i2) + 1) ^ i1, where the equality check returns 0 or 1. Check out the following table, where each column corresponds to one input, each row corresponds to one operation, and each cell will show the stack at that point:
[i1, i2]:  [0, 0]     [0, 1]     [1, 0]     [1, 1]
copy i1:   [0, 0, 0]  [0, 1, 0]  [1, 0, 1]  [1, 1, 1]
equals:    [0, 1]     [0, 0]     [1, 0]     [1, 1]
inc:       [0, 2]     [0, 1]     [1, 1]     [1, 2]
xor:       [2]        [1]        [0]        [3]

With that in mind here is the full breakdown of the source code:
ri     e# Read input, convert to integer.
2b     e# Get binary representation.
G0e[   e# Pad to 16 bits with zeros.
8/     e# Split into two halves of 8 bits each.
:.{    e# For each pair of bits, i1 and i2...
  1$   e#   Copy i1.
  =    e#   Check equality with i2.
  )    e#   Increment.
  ^    e#   Bitwise XOR.
  'A+  e#   Add to 'A'
}

An alternative solution with the same byte count which is decidedly less magical:
ri2bG0e[8/z2fb"CBAD"f=

And in case it's useful to anyone, if you turn the i1 and i2 bits back into a single number (i.e. when you want the mapping 0 -> 2, 1 -> 1, 2 -> 0, 3 -> 3) this can be computed even more easily as (~n - 1) & 3 or (~n - 1) % 4 if your language gets modulo on negative values right. I think this can be written concisely as 3&~-~n in many languages. In CJam this turns out to be a byte longer, because of the additional conversion back from base 2.

Perl, 42 bytes
Includes +1 for -n
Give input on STDIN:
perl -nE 'say+(A..D)[2-($`>>8-$_&257)%127]for/$/..8' <<< 39253

Just the code:
say+(A..D)[2-($`>>8-$_&257)%127]for/$/..8

MATL, 16 bytes
16&B8eXB'BADC'w)

Try it Online!
or Verify all test cases
Explanation
        % Implicitly grab input
16&B    % Convert to binary string with at least 16 bits
8e      % Reshape the resulting string to have 8 rows and 2 columns
XB      % Convert each row from binary to decimal
'BADC'  % Push this string literal
w)      % Use the decimal numbers to index into this string (modular indexing)
        % Implicitly display the resulting string

Julia, 73 Bytes
Gives a function f taking N as input and returning the answer as string.
f(N)=(b=bin(N,16);join(["CBAD"[parse("0b$(b[i])$(b[i+8])")+1]for i=1:8]))

Try it
Depending if a char array counts as string, one can omit the join (67 Bytes)
f(N)=(b=bin(N,16);["CBAD"[parse("0b$(b[i])$(b[i+8])")+1]for i=1:8])

Try it

R, 110 bytes
Came up with a vectorized solution in R. This should probably by golfable by coming up with a smarter conversion int to binary conversion.
x=as.integer(intToBits(scan()));cat(LETTERS[1:4][match(paste0(x[16:9],x[8:1]),c("10","01","00","11"))],sep="")


text:
Tips for golfing in Emotinomicon
What general tips do you have for golfing in Emotinomicon? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Emotinomicon (e.g. "remove comments" is not an answer).
Please post one tip per answer.

Please help popularise Emotinomicon, if you can. As it stands right now, only 2 people use it AFAIK (me and Conor O'Brien).

While this is an interesting idea, there isn't precisely much room for golfing in this language, except for perhaps changing program flow. Other than that, a lot of the tips that would apply here would apply to other languages with similar code layouts.

@ConorO'Brien I know, but I have alerady posted 4 answers, and might post more.

While that's true, half of them are interpreter bugs that I might fix in the future.

@ConorO'Brien That's why I've said "right now". Also, there are currently 2 of them.

Why the downvote?

@daHugLenny I don't know, maybe it was a Community Autodownvote, or someone just not liking the simplicity of this post, or even someone who wants to just cost me rep (those guys get their votes removed).

Should be answers to respective challenges (if they exist). Note that some of these code samples might alerady be answers somewhere else.
If you just want to print undefined, use this 4-byte, 1-char program.

Infinite loop (6 bytes, 2 chars).
ℹ⏩

Cat (owned by Conor O'Brien) (15 bytes, 5 chars).
⏫⏪⏬⏫⏩

This program should output the 8 phases of the moon, but it doesn't seem to work (61 bytes, 16 chars).
⏪⏬⏩

Hypothenuse (27 bytes, 7 chars).
➕

It's because the string implementation grabs surrogates as well. I'll fix this sometime today, probably.

Make use of built-ins.
Some cases are:

⁉❕ -> ❔
The numbers 0-10, 100 and i are ℹ, respectively.
Multiplication with 2-4 is done with ☺, respectively.
Division with 2-4 is done with , respectively.
Exponentiation with 2-4 is done with , respectively.
Rooting:

n-Rooting with n being 2-4 is done with , respectively.
For other n, use n➗. n is not a literal n, but the power of rooting.

Infinite Looping
If you want to loop a program infinitely, from index n, you can use n to jump behind the nth character. For example, this 34-byte, 12-char program for yes:
⏪sey⏪⏬⏩⏩

Becomes this 32-byte, 11-char program:
sey⏪⏬⏩

It seems like I've got the grasp of it... if anyone is wondering, the yes idea originated here.

If you just want a truthy value (or even just a value), without using it, use ℹ. It's 3 bytes, while the others are 4 bytes.

I used this for the infinite loop challenge.

If you want to output 2 chars or less, do not use ⏪⏬⏩, use the number of ⏬s needed.

Because of a bug in the interpreter, if you want to append 1 to a number (e.g. 10 -> 101), use . As it is right now, you have to use ➕ for the true function of .

I believe this bug is because JavaScript "123"+1 -> "1231".


text:
Introduce Your Language!
Your task is to write a program or function that takes a string as input, and prints Hello (input), I'm (language name).
Examples
Python:
Input: Oliver
Output: Hello Oliver, I'm Python
C++:
Input: Jacob
Output: Hello Jacob, I'm C++
etc.
Remember, this is code-golf, so the code with the lowest number of bytes wins.
Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=94485,OVERRIDE_USER=12537;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

@BetaDecay The output is different and the input is different. Therefore, the question is not a duplicate.

I strongly disagree: they're basically the same question with a trivial difference

@BetaDecay they're different as the birthday one is constant output - no input

@muddyfish The addition of the input isn't sufficient to distinguish this from the birthday challenge in my opinion. If you want to be picky, this is a half-dupe of cat and a half-dupe of happy birthday. Two half-dupes with a trivial combination makes a whole dupe.

@Mego It's not, because that requires it to print only on a specific day.

Possible duplicate of Sing Happy Birthday to your favourite programming language

pl, 15 bytes
Hello _, I'm pl

Try it online!

Python, 29 bytes
"Hello {}, I'm Python".format

Strings methods for the win! The built-in method format of a string substitutes the arguments (here a single string) into any replacement fields (here {}).
Usage:
f = "Hello {}, I'm Python".format
print f("xnor")

Hello xnor, I'm Python

Previous 30-byte:
"Hello %s, I'm Python".__mod__

You can remove the exclamation point.

Assembly (x86-64, Linux), 217 205 bytes
4927 segmentation faults later...
.global main
.data
s:.ascii"Hello %qs, I'm Assembly\n"
f:.ascii"%qs"
i:.ascii""
main:mov $i,%rsi
mov $f,%rdi
mov $0,%rax
call scanf
mov $0,%rax
mov $i,%rsi
mov $s,%rdi
call printf
end:mov $0,%rax
call exit

Doesn't work for inputs with a length greater than 7, because this exceeds the memory limits of a quadword(?). Also, because I'm a noob in Assembly.
Explanation:
.global main

.data

output_string: .ascii "Hello %qs, I'm Assembly\n"
format_input: .ascii "%qs"
input_string: .ascii ""

main:
    mov $input_string, %rsi     # Place the memory address to the second argument
    mov $format_input, %rdi     # Place the format string to the first argument
    mov $0, %rax                # Set RAX to 0
    call scanf                  # Call scanf with RDI and RSI as the arguments

    mov $0, %rax                # Set RAX to 0
    mov $input_string, %rsi     # Place the input string to the second argument
    mov $output_string, %rdi    # Place the output format to the first argument
    call printf                 # Call printf with RDI and RSI as the arguments

end:
    mov $0, %rax                # Set RAX to 0 (which is the exit code)
    call exit                   # Call the exit function

Save in a file called myProgram.s and do the following:
$ gcc -o myProgram myProgram.s
$ ./myProgram

05AB1E, 21 17 bytes
”Ÿ™ ÿ, I'm 05AB1E

Try it online!

Java, 88 bytes
interface A{static void main(String[]a){System.out.print("Hello "+a[0]+", I'm Java!");}}

Takes input on first command-line argument. Verbose Java is verbose.

You can write a function/method instead of a full program.

Jelly, 16 bytes
“' ṗr>ƊḳȧT°ḋZ»Ỵj

Try it online!
How it works
Call the argument of the main link s.
“' ṗr>ƊḳȧT°ḋZ»

represents an integer in bijective base 256 that encodes a sequence of dictionary words and/or characters. In this specific case, it encodes the dictionary word Hello, followed by ¶, I'm with a leading space (¶ represents a linefeed), followed by the dictionary word Jelly with a leading space.
The result is as follows.
Hello
, I'm Jelly

The Ỵ atoms splits this string at linefeeds, yielding the following array.
["Hello ", "", I'm Jelly"]

Finally, the j atom joins that array, using the string s as separator.

Cheddar, 26 bytes
"Hello %s I'm Cheddar"&(%)

Functional approach ftw

Straw, 25 bytes
(Hello b, I'm Straw!)b</>

Try it online!
Simple regex substitution.

Minecraft, 27 bytes
say Hello @p, I'm Minecraft

say Prints the given string and replaces @p with the name of the nearest player

MATL, 24 bytes
'Hello %s, I''m MATL'jYD

Try it Online!

Element, 28 bytes
Hello\ _\,\ I\'m\ Element..`

(link to TIO)
Woo! Two months since this site's previous Element answer!

Am I right in assuming that \ is the escape character, and that it escapes the spaces? If so, why do they have to be escaped?

@ConorO'Brien Normally, two words separated by a space are pushed as two separate tokens.  For example, 2 3 pushes a 2 and a 3, while 2\ 3 pushes 2 3.  There's no special processing to distinguish literal words from literal numbers, they are all represented by scalars in Perl.

Batch, 25 bytes
@echo Hello %*, I'm Batch

Conveniently ' isn't a quote character in Batch.

The spelling was changed in the question to remove a !

@ConorO'Brien Serves me right for copying from the sh answer.

Emotinomicon, 73 bytes
Hello✖➕⏫, I'm Emotinomicon⏪⏬⏩

If you go to the Interpreter you can generate an explanation
Thanks to @Oliver Ni for make me notice that bug that Emotinomicon removes whitespaces at the end of the String literal

I count 50 bytes

You're right I missed that although I will add two bytes back to add whitespaces between the name and the literals.

You need a space after Hello. It is currently printing HelloOliver, I'm Emotinomicon.

sh, 24 bytes
echo "Hello $1, I'm sh!"

I'm getting sh.exe": !": event not found but that might be windows only

Works for me on void linux.

In pure sh you can probably use \' and remove the quotes to save a byte. Other shell versions probably want you to quote the ! too, but at least that doesn't end up costing anything overall.

Although as @ConorO'Brien points out the ! is no longer part of the question.

Pyke, 21 bytes
"Hello , I'm Pyke"6Q:

Try it here!

Nim, 40 bytes
echo "Hello "&stdin.readAll&", I'm Nim!"

PHP, 29 Bytes
<?="Hello $argv[1], I'm PHP";

Pyth, 21 bytes
X6"Hello , I'm Pyth"Q

Try it here!

JavaScript, 32 bytes
x=>`Hello ${x}, I'm JavaScript`

Simple enough. ${x} is inline x, the argument.

C, 50 39 bytes
f(char*s){printf("Hello %s, I'm C",s);}

A function would be considerably shorter.

J, 22 bytes
', I''m J',~'Hello '&,

This is a fork:
', I''m J' ,~ 'Hello '&,

'Hello '&, prepends Hello and ', I''m J' ,~ appends , I'm J.
Example run:
   (', I''m J',~'Hello '&,)'Conor'
Hello Conor, I'm J

Jolf, 20 17 bytes
"Ξ\x08£C¦i, I‘m Jolf

Try it here! Replace \x08 with the literal character.
¦i is interpolated input, and Ξ\x08£C is compressed form of Hello with a trailing space. This outputs, for input Conor:
Hello Conor, I'm Jolf

Alternatively, for 23 bytes:
"Hello ¦i, I‘m ¦ᖒ

dc, 23 bytes
[, I'm dc!]?[Hello ]PPP

dc doesn't provide any means of getting raw strings, so you have to wrap your input in [brackets]. For example:
$ dc hello.dc <<< [Daniel]
Hello Daniel, I'm dc!

GolfScript, 27 bytes
"Hello "\", I'm GolfScript"

Takes input from STDIN.

Ruby, 32 bytes
puts "Hello #{$*[0]}, I'm Ruby"

Save as intro.rb, run as ruby intro.rb <name>.

Scala, 25 bytes
n=>s"Hello $n, I'm Scala"

To use it, assign this function to a variable.
val greeting = n=>s"Hello $n, I'm Scala"
greeting("Jacob")

I didn't expect that you can drop the type annotation if the parameter is of type Any.

Wren, 33 bytes
Fn.new{|x|"Hello %(x), I'm Wren"}

Try it online!
Explanation
Fn.new{|x|                      } // New anonymous function
          "Hello %(x), I'm Wren"  // Surrounding the input w/ Hello & wren

Python, 33 bytes
lambda a:"Hello %s, I'm Python"%a

S.I.L.O.S 112 110 bytes

loadLine
def : lbl
print Hello
a=256
:a
x=get a
if x c
if 1 e
:c
printChar x
a+1
if x a
lble
print , I'm S.I.L.O.S

It should be loosely readable. Just a trivial modification of the cat program
Try it online!

You can remove the spaces in a + 1

CJam, 21 bytes
"Hello "l", I'm CJam"

Try it online!

sed, 22 bytes
s/.*/Hello &, I'm sed/

Try it online!
Run:
sed -f hello.sed <<< "PPCG"

Output:
Hello PPCG, I'm sed

Turing Machine Code, 360 bytes
0 * * l 1
1 _ [ l 2
2 _ o l 3
3 _ l l 4
4 _ l l 5
5 _ e l 6
6 _ H * 7
7 [ _ r 8
7 * * r *
8 _ ,  r 9
8 * * r *
9 _ _ r I
I _ I r '
' _ ' r m
m _ m r ~
~ _ _ r T
T _ T r u
u _ u r r
r _ r r i
i _ i r n
n _ n r g
g _ g r #
# _ _ r M
M _ M r a
a _ a r c
c _ c r h
h _ h r í
í _ i r ñ
ñ _ n r e
e _ e r ^
^ _ _ r C
C _ C r o
o _ o r d
d _ d r è
è _ e r halt

Try it online!

W j, 17 14 bytes
Short language names for the win. (I beat pl, and Dennis as well)
L~¶├'◄b₧û☻♪▼ºº

Explanation
Hello "           % Start the output string with "Hello"
       a          % Insert the input onto the stack
        ", I'm W" % End the output string with ", I'm W"
                  % Implicit join whole stack at the end of the program

GolfScript, 28 bytes
"Hello
, I'm GolfScript"n/*

Try it online!
Explanation
"Hello
, I'm GolfScript"    # Define the string to be inserted: "Hello \n, I'm GolfScript"
                 n/  # Split upon newlines             : ["Hello " ", I'm GolfScript"]
                   * # Join the array by input         : ["Hello input, I'm GolfScript"]


text:
Pre-order + post-order to in-order
Task
Given the pre-order and post-order traversals of a full binary tree, return its in-order traversal.
The traversals will be represented as two lists, both containing n distinct positive integers, each uniquely identifying a node. Your program may take these lists, and output the resulting in-order traversal, using any reasonable I/O format.
You may assume the input is valid (that is, the lists actually represent traversals of some tree).
This is code-golf, so the shortest code in bytes wins.
Definitions
A full binary tree is a finite structure of nodes, represented here by unique positive integers.

A full binary tree is either a leaf, consisting of a single node:
                                      1

Or a branch, consisting of one node with two subtrees (called the left and right subtrees), each of which is, in turn, a full binary tree:
                                      1
                                    /   \
                                  …       …

Here’s a full example of a full binary tree:
                                        6
                                      /   \
                                    3       4
                                   / \     / \
                                  1   8   5   7
                                     / \
                                    2   9

The pre-order traversal of a full binary tree is recursively defined as follows:

The pre-order traversal of a leaf containing a node n is the list [n].
The pre-order traversal of a branch containing a node n and sub-trees (L, R) is the list [n] + preorder(L) + preorder(R), where + is the list concatenation operator.

For the above tree, that’s [6, 3, 1, 8, 2, 9, 4, 5, 7].

The post-order traversal of a full binary tree is recursively defined as follows:

The post-order traversal of a leaf containing a node n is the list [n].
The post-order traversal of a branch containing a node n and sub-trees (L, R) is the list postorder(L) + postorder(R) + [n].

For the above tree, that’s [1, 2, 9, 8, 3, 5, 7, 4, 6].

The in-order traversal of a full binary tree is recursively defined as follows:

The in-order traversal of a leaf containing a node n is the list [n].
The in-order traversal of a branch containing a node n and sub-trees (L, R) is the list inorder(L) + [n] + inorder(R).

For the above tree, that’s [1, 3, 2, 8, 9, 6, 5, 4, 7].

In conclusion: given the pair of lists [6, 3, 1, 8, 2, 9, 4, 5, 7] (pre) and [1, 2, 9, 8, 3, 5, 7, 4, 6] (post) as input, your program should output [1, 3, 2, 8, 9, 6, 5, 4, 7].
Test cases
Each test case is in the format preorder, postorder → expected output.
[8], [8] → [8]
[3,4,5], [4,5,3] → [4,3,5]
[1,2,9,8,3], [9,8,2,3,1] → [9,2,8,1,3]
[7,8,10,11,12,2,3,4,5], [11,12,10,2,8,4,5,3,7] → [11,10,12,8,2,7,4,3,5]
[1,2,3,4,5,6,7,8,9], [5,6,4,7,3,8,2,9,1] → [5,4,6,3,7,2,8,1,9]

Since the input is guaranteed to have a specific shape (a complete binary tree), you don't really need both inputs, do you?

The binary tree is full, but not complete, so an n-element tree can have many shapes, and, in general, you do need both.

May I represent the nodes as single letters giving strings for the orders. E.g. the second example would become: "CDE" and "DEC" give "DCE" ? (even using unicode letters if I need lots of nodes)

@TonHospel I’d be okay with that — arguably, all you’re doing is stretching the definition of a list of integers a little, because "CDE" isn’t very different from [67, 68, 69] :)

Perl, 69 66 62 56 53 bytes
Includes +1 for -p
Takes postorder followed by preorder as one line separated by space on STDIN (notice the order of pre and post). Nodes are represented as unique letters (any character that is not space or newline is OK).
inpost.pl <<< "98231 12983"

inpost.pl:
#!/usr/bin/perl -p
s%(.)(.)+\K(.)(.+)\3(\1.*)\2%$4$5$3$2%&&redo;s;.+ ;;

Using the original purely numeric format needs a lot more care to exactly identify a single number and comes in at 73 bytes
#!/usr/bin/perl -p
s%\b(\d+)(,\d+)+\K,(\d+\b)(.+)\b\3,(\1\b.*)\2\b%$4$5,$3$2%&&redo;s;.+ ;;

Use as
inpostnum.pl <<< "11,12,10,2,8,4,5,3,7 7,8,10,11,12,2,3,4,5"

-p adds a ; at the end, so you don't need the last ;. s;.* ;; -> s;.* ;

@Riley I know. That's why I have the ; at the end. But -p actually adds \n; to the end in a -e program. In a file it adds just ; if and only if the file does not end on \n. Since I want to claim -p as +1 and not +3 the program needs to work from the commandline, so with -e. And I don't want the spurious newline in the output I would then get

If you run it on the commandline don't you need ' around it? If you run it the way you have it (call a file with <<<) you can leave the last ; off.

@Riley It depends on the interpretation of the scoring method for perl. I usually submit my code as a file since I think that is less ephemeral. But if you look at my submissions you will see that if the code must be in a file (because e.g. it has ' or uses do$0 etc.) I always score -p as +3 (space,minus,p), but if the code would also work on the commandline where you get the -e and the ' for free I score it as +1 since it can be bundled with the e

Okay, I just wasn't clear on exactly how command line submissions score. I didn't realize you get ' for free. Thanks for clearing that up.

Haskell, 84 83 bytes
(a:b:c)#z|i<-1+length(fst$span(/=b)z),h<- \f->f i(b:c)#f i z=h take++a:h drop
a#_=a

JavaScript (ES6), 100 bytes
f=(s,t,l=t.search(s[1]))=>s[1]?f(s.slice(1,++l+1),t.slice(0,l))+s[0]+f(s.slice(l+1),t.slice(l)):s[0]

I/O is in strings of "safe" characters (e.g. letters or digits). Alternative approach, also 100 bytes:
f=(s,t,a=0,b=0,c=s.length-1,l=t.search(s[a+1])-b)=>c?f(s,t,a+1,b,l)+s[a]+f(s,t,l+2+a,l+1,c-l-2):s[a]

APL (Dyalog Extended), 31 bytes
{0::⍵⋄∊2⌽∇¨⍵⊂⍨¯⍸1 2,2⊃⍋⍵}⍤⌽⍤⍳⊇⊣

Try it online!
An anonymous infix function that takes the preorder on its left and the postorder on its right.
How it works
This solution uses multiple APL-specific features.
Given the input [7,8,10,11,12,2,3,4,5], [11,12,10,2,8,4,5,3,7], it first computes the index of (⍳) each number in the right arg inside the left arg. The index is 1-based by default. This allows to work on a single array instead of two arrays. We will manipulate the array of "indices" until the very end.
      pre←7 8 10 11 12 2 3 4 5 ⋄ post←11 12 10 2 8 4 5 3 7
      pre ⍳ post
4 5 3 6 2 8 9 7 1

Then take the reverse ⌽:
      ⌽4 5 3 6 2 8 9 7 1
1 7 9 8 2 6 3 5 4

At this point, we can identify the root and left and right branches: 1 is the root, 7 9 8 (after 1 and before 2) are on the right branch, and 2 6 3 5 4 are on the left branch. Each branch can be handled recursively (where the first element is the root of the branch, and that +1 splits the left and right branches). So we create a recursive inline function {...} where ⍵ denotes the argument and ∇ is the recursive call.
Inside it, we will eventually split the array 1 7 9 8 2 6 3 5 4 to 3 subarrays (1)(7 9 8)(2 6 3 5 4). We can use "partition" ⊂, which splits the array at ones as the starting point, so giving 1 1 0 0 1 0 0 0 0 will do.
      1 1 0 0 1 0 0 0 0⊂1 7 9 8 2 6 3 5 4
┌─┬─────┬─────────┐
│1│7 9 8│2 6 3 5 4│
└─┴─────┴─────────┘

2⊃⍋⍵ is a short way to extract the index of the second smallest element. ⍋ is called "grade up", which is related to sorting but doesn't sort the elements directly; instead, it tells us which element should go where in the sorted array. So the result looks like [index of the smallest, index of the 2nd smallest, ..., index of the largest]. Naturally, taking the second element from that gives index of the 2nd smallest.
      {2⊃⍋⍵}1 7 9 8 2 6 3 5 4
5

It gives the position of the third 1 in the partition marker. The first and second are trivial (1 and 2). So we concatenate (,) the 5 with 1 2, and convert it to the counts (¯⍸) giving [count of 1s, count of 2s, ...]:
      {¯⍸1 2,2⊃⍋⍵}1 7 9 8 2 6 3 5 4
1 1 0 0 1

⊂ in Extended accepts short markers, so we can use the above to partition ⍵:
      {⍵⊂⍨¯⍸1 2,2⊃⍋⍵}1 7 9 8 2 6 3 5 4
┌─┬─────┬─────────┐
│1│7 9 8│2 6 3 5 4│
└─┴─────┴─────────┘

Now it's time for recursive call. 2⊃⍋⍵ on a single-element array will error, so we guard it with 0::⍵ (catch any error and return the argument as-is). On the result, the left branch should be on the left of the root, so we rotate the result twice to the left 2⌽, and flatten it ∊.
      {0::⍵⋄∊2⌽∇¨⍵⊂⍨¯⍸1 2,2⊃⍋⍵} 1 7 9 8 2 6 3 5 4
4 3 5 2 6 1 8 7 9

Finally, we convert each of the "indices" to the number at that index in the preorder (the left arg).
      4 3 5 2 6 1 8 7 9 ⊇ pre
11 10 12 8 2 7 4 3 5

For comparison, porting the Haskell answer is quite longer:
APL (Dyalog Extended), 42 bytes
{0::⍺⋄l←⍵⍳2⊃⍺⋄(⍵∇⍨l↑1↓⍺),(⊃⍺),(l↓1↓⍺)∇l↓⍵}

Try it online!

Python 3.8 (pre-release), 85 bytes
f=lambda a,b:a==b and a or f(a[1:(i:=a.find(b[-2]))],b[:i-1])+a[0]+f(a[i:],b[i-1:-1])

Try it online!
Input is 2 strings, each string can contain any character.
Explanation:
Consider the input:
Preorder  631829457
Postorder 129835746

We can split each input into 3 parts (the root, the left subtree, and right subtree) as follows:

The first character in the preorder traversal must be the root. Similarly, the last character in the postorder traversal must also be the root.
Since 4 is the second-to-last character in the postorder string, we know that 4 must be the root of the right subtree. This means that 4 must be the first character in the preorder string of the right subtree.

Preorder  6 | 31829 | 457
Postorder     12983 | 574 | 6

We can then recurs on the left and right part.