[Question]
  [
I love math. But I can't find a single calculator that can multiply correctly. They seem to get everything right except 6\*9 (It's the question to life, the universe, and everything! How could they get that wrong?!). So I want you all to write a function for me that can multiply 2 numbers correctly (and 6\*9 equals 42 instead of 54. 9\*6 equals 54 still).
Oh, and I'm going to have to build the source in Minecraft so... fewest bytes win!
Recap
* Take 2 numbers as input (type doesn't matter, but only 2 items will be passed, and order must be consistent. So streams, and arrays are ok as long as they preserve the order they where passed in. I.e., a map won't work because it doesn't preserve the order)
* Output multiple of both numbers except if they are 6 and 9, then output 42 (order matters!)
	+ PS. I never was really good with counting, so I think only integers from 0 to 99 are real numbers (type used doesn't matter)
* Fewest bytes per language wins!
**Leaderboard:**
```
var QUESTION_ID=124242,OVERRIDE_USER=61474;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="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+r.match(SCORE_REG)[0],language:r.match(LANG_REG)[0].replace(/<\/?[^>]*>/g,"").trim(),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;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>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=/\d+((?=$)|(?= Bytes))/i,OVERRIDE_REG=/^Override\s*header:\s*/i;LANG_REG=/^[^,(\n\r]+/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}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=617d0685f6f3"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
## Mathematica, 15 bytes
Byte count assumes Windows ANSI encoding (CP-1252).
```
6±9=42
±n__:=1n
```
Defines a binary operator `±` which solves the problem. We simply define `6±9=42` as a special case which takes precedence and then add a fallback definition which makes `±` equal to multiplication. The latter uses a fairly interesting golfing trick. The reason this works is actually quite elaborate and we need to look into *sequences*. A sequence is similar to what's known as a *splat* in other languages. It's basically a "list" without any wrapper around it. E.g. `f[1, Sequence[2, 3, 4], 5]` is really just `f[1, 2, 3, 4, 5]`. The other important concept is that all operators are just syntactic sugar. In particular, `±` can be used as a unary or binary operator and represents the head `PlusMinus`. So `±x` is `PlusMinus[x]` and `a±b` is `PlusMinus[a,b]`.
Now we have the definition `±n__`. This is shorthand for defining `PlusMinus[n__]`. But `n__` represents an arbitrary *sequence* of arguments. So this actually adds a definition for binary (and n-ary) usagess of `PlusMinus` as well. The value of this definition is `1n`. How does this multiply the arguments? Well, `1n` uses Mathematica's implicit multiplication by juxtaposition so it's equivalent to `1*n`. But `*` is also just shorthand for `Times[1,n]`. Now, `n` is sequence of arguments. So if we invoke `a±b` then this will actually become `Times[1,a,b]`. And that's just `a*b`.
I think it's quite neat how this syntax abuse lets us define a binary operator using unary syntax. We could now even do `PlusMinus[2,3,4]` to compute `24` (which can also be written as `±##&[2,3,4]` or `2±Sequence[3,4]` but it's just getting crazy at that point).
[Answer]
# [Haskell](https://www.haskell.org/), 14 bytes
```
6&9=42
a&b=a*b
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/30zN0tbEiCtRLck2USvpf25iZp6CrUJKPpeCQkFRZl6JgoaRgpqCiSaCbwnkmyHxzYB8S83/AA "Haskell – Try It Online")
[Answer]
# C, ~~32~~ ~~31~~ ~~29~~ 28 bytes
-2 thanks to Digital Trauma  
-1 thanks to musicman523
```
#define f(a,b)a^6|b^9?a*b:42
```
Pretty simple. Declares a macro function `f` that takes two arguments, `a` and `b`.  
 If `a` is `6` and `b` is `9`, return `42`. Otherwise return `a` x `b`.
[Try it online!](https://tio.run/##S9ZNT07@/185JTUtMy9VIU0jUSdJMzHOrCYpztI@USvJysTof25iZp6GZnVBUWZeSZqGUlBqcWlOiUJ@mkIukM4syMlMTizJzM@zUlBNUdJJ0zDTsdTUtK79DwA)
[Answer]
# JavaScript (ES6), 20 bytes
```
x=>y=>x-6|y-9?x*y:42
```
**Explanation:**
Iff x==6 and y==9, `x-6|y-9` will be 0 (falsy), and 42 will be the result.
**Snippet:**
```
f=
x=>y=>x-6|y-9?x*y:42
console.log(f(6)(9));
console.log(f(9)(6));
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~30~~ 29 bytes
Thanks to *Jonathan Allan* for saving a byte!
```
lambda x,y:x*[y,7][6==x==y-3]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfpmCrEPM/JzE3KSVRoUKn0qpCK7pSxzw22szWtsLWtlLXOPZ/QVFmXolCmoaZjoKlJheMZ6mjYIbgmegomGr@BwA "Python 2 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~15~~ ~~11~~ 9 bytes
-4 bytes thanks to @Emigna
-2 bytes thanks to @Adnan
```
P¹69SQi42
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/4NBOM8vgwEwTo///o810FCxjAQ "05AB1E – Try It Online")
How it works
```
P          # multiply input
 ¹         # push first number
  69       # the number 69
    S      # split per character
     Q     # equality for both inputs
       i42 # if so, print 42
           # otherwise print product
```
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), ~~24~~ 22 bytes
*-2 bytes thanks to @OlivierGrégoire*
```
a->b->a==6&b==9?42:a*b
```
[Try it online!](https://tio.run/##jU2xCsIwFNz7FW@SRmwGEaFq6iY4OHUUh9faltQ0Cc2rINJvrxGii4u33HHv3V2Ld0yMrXR7vU2ys6YnaL3HB5KK14MuSRrND0FsIzsUSpZQKnQOTig1PCPwCL4jJE93I6/Q@WucUy91c74A9o1j4fmNT@XuqKlqqn7xYwTOMqhBwIRJViQZCrGeFUKk@9Vyg/Ni@vRtv835w1HVcTMQt36clI5rjtaqR7xmQaSM/RVI2TcZAmM0Ti8 "Java (OpenJDK 8) – Try It Online")
[Answer]
# Ruby, 24 bytes
```
->a,b{a==6&&b==9?42:a*b}
```
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~158~~ ~~154~~ ~~148~~ ~~140~~ ~~138~~ 126 bytes
```
(({}<>)(((([()()()]<>)){})<({}{}({}))>{(()()()){}(<{}>)}{}))([()]{()(<{}>)}{})(({<{}>{}((<>))}{}){}<{}>{<({}[()])><>({})<>}{})
```
[Try it online!](https://tio.run/##PYyxCoAwDER3vyQ3uApCyI9IBx0EURxcQ7693iHYQkneXd/2rMc97td69m6W5QHjWQy6jSuy4Eyy@ACR9mXk5lmBEtaPluQ/ok0zWyaLEPUisqmO8JDTQ2Hv0zC/ "Brain-Flak – Try It Online")
# Explanation
This code is pretty simple. We make copies of the top two items on the stack, we subtract 6 from one and 9 from the other. We then take the `not` of the two values. We `and` those values, multiply the result by 12. Multiply the inputs and subtract the two results.
[Answer]
# Factorio, 661 bytes, 6 combinators with 9 connections
There is one constant combinator set to output A and B. Change these to set the input.
Blueprint string (0.15.18):
```
0eNrNVm2O2jAQvcv8rEKFvSHLRuqPtrfYCkUhGWAkYkfOGDVCOUBv0bP1JLWTLQuB3U0QbfcPYvzxZt68eYr3sNxaLA0phngPlGlVQfxtDxWtVbr1a1yXCDEQYwEBqLTwUY4Z5WgmmS6WpFLWBpoASOX4HWLRBG8C+EScKr6MIJtFAKiYmLCrpw3qRNliicaleK2SAEpduata+fQObiI+zgKo/R+XIyeDWbcrA18IG71NlrhJd+RuuytPmInby1ucyq+uyFScnPHakWHrVg4VdScmnz2fPzQhjnxQlKlpS4zhk7ugLZd2BCTu0NS8IbXusMvalWgVJyuji4SUA4OYjcWmS606nm31wv8YzI+7SS66axbusHxh1zeITGaJ21C4w41XtyeHHCXH9D+o8eVUjYd3qoY47bc86rWPo158/yze2iCqPtxsmHx3r9ry3E6ylU9cTUv0aITDygwPZaaGeFMgUzbM99NBg/aMegPnV+gxRg6oLtFNZFsjfLhiJB+huZn1B87O7Crr/0Pnfz11vug5/9ePn+/E+2Hf++4beNHV8uzgRWWica6ejnDKiraM5oWXwhtC2CcVDo+FxfAWDfwc3Y9jLv4288cj5qG8IXU3Ie2zKj56xgXgZrNqOURhKGfR/GE6nzfNb7OMaxo=
```
The output is signal Z and is to be taken from the top and bottom deciders.
[![Screenshot](https://i.stack.imgur.com/MWERB.png)](https://i.stack.imgur.com/MWERB.png)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 7 bytes
```
Vf96SạP
```
Input is as an array of two integers: first the right operand, then the left one.
[Try it online!](https://tio.run/##y0rNyan8/z8szdIs@OGuhQH/D7c/alqj4K3wcMf2Rw1zFHwTCxTyy1KLFEoyUhUy8wpKS3RAzDyF4tSCxKLEklSFpEqF4oLE5NRivf//o811FMxjdRSiLXUUzGIB "Jelly – Try It Online")
### How it works
```
Vf96SạP  Main link. Argument: [b, a]
V        Cast [b, a] to string, then eval the resulting string.
         For [b, a] = [9, 6], this yields 96.
 f96     Filter with 96, yielding [96] if V returned 96, [] otherwise.
    S    Take the sum, yielding either 96 or 0.
      P  Compute the product of [b, a], yielding ba = ab.
     ạ   Compute the absolute difference of the results to both sides.
         When the sum is 0, this simply yields the product.
         However, when [b, a] = [9, 6], this yields 96 - 54 = 42.
```
[Answer]
## Factorio, 581 bytes, 3 combinators with 4 connections
Blueprint string (0.16.36):
```
0eNqllNtu4jAQht9lLldmldNCFWkvto/RCkUhGWAkYkfOGDVCefeOnV1Km7ACemPJ9vibf04+webgsLWkGfITUGV0B/nrCTra6fLgz7hvEXIgxgYU6LLxO2/HpeZFZZoN6ZKNhUEB6RrfII+HtQLUTEw44sKmL7RrNmjF4AyqsaIa7SVHQWs6eWq0dy+46OcvBT3ki1hc1GSxGi8T5XWwNYdig/vySPJYXvxFFnJXB0znT7dkOy4mYR3JspOTs6DRYoFHtD3vSe98XP/CFZ9xtsqe0mW29KdNW9qgOYffgjCOW3eHk+eR3fai1WkuttY0BWlhQM7W4TC61mPAIYzYLxbry6yS7FKxJFs54rANFdhZRP3VMBnWQk08ZvZ+ChpExqSCyX9bYVLCRfxRwbmabenAaK+03rX0/RnT5z7VJbroQnUH7HkGlq7OsDFtc8WYzWJ8WxbTs4rSEu8bZKpuGoXopkn4gH5vGEKiO/SMO5vbtCgDEjTCjwcm5AWGO4ZgknX16Tq7OhRfHiZXypU91PTRd6ZYdIjo8PnmF3+1AvmfuuBq+bRKYmnWKM2G4R1hAPnz
```
The bottom left constant combinator should be set to output A and B as input. The output is signal Z from the bottom right arithmetic combinator.
[![enter image description here](https://i.stack.imgur.com/dtthF.png)](https://i.stack.imgur.com/dtthF.png)
```
Top left: 2147483640 A, 2147483637 B
Top right: If everything = 2147483646 output B, input count
Bottom left: (input) A, (input) B
Bottom right: A * B -> Z
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 11 bytes
```
[BE]=?42}Gp
```
Input is an array with the two numbers.
[Try it online!](https://tio.run/##y00syfn/P9rJNdbW3sSo1r0AyDHTUbCMBQA "MATL – Try It Online")
### Explanation
```
[BE]    % Push array [6, 9]
=       % Implicit input: array of two numbers. Compare with [6, 9] element-wise
?       % If the two entries are true
  42    %   Push 42
}       % Else
  G     %   Push input
  p     %   Product of array
        % Implicit end. Implicit display
```
[Answer]
# [R](https://www.r-project.org/), 33 bytes
```
function(a,b)`if`(a-6|b-9,a*b,42)
```
Returns a function.
[Try it online!](https://tio.run/##K/qfoKqlmmD7P600L7kkMz9PI1EnSTMhMy1BI1HXrCZJ11InUStJx8RI87@ZAlClgiWXJZg24zIE08b/AQ "R – Try It Online")
[Answer]
# [GW-BASIC](//en.wikipedia.org/wiki/GW-BASIC), 55 bytes
```
1INPUT A:INPUT B
2IF A=6THEN IF B=9THEN ?"42":END
3?A*B
```
Output:
[![output](https://i.stack.imgur.com/uRqRY.png)](https://i.stack.imgur.com/uRqRY.png)
The first machine at [pcjs](https://pcjs.org) has IBM BASIC, which is practically the same thing. To test this, head over there, hit `Run` on the machine, Press `Enter`-`Enter` and type `BASICA` to get into BASIC mode. Then enter the source code (it will automatically prettyprint for you), type `RUN`, input two integers, and done!
[Answer]
# JavaScript (ES6), 25 bytes
```
x=>y=>[x*y,42][x==6&y==9]
```
[Answer]
## [Check](https://github.com/ScratchMan544/check-lang), ~~34~~ 33 bytes
```
.:+&>#v
#>42#v#9-!\>6-!*?
 d* ##p
```
Check is my new esolang. It uses a combination of 2D and 1D semantics.
Input is two numbers passed through command line arguments.
### Explanation
The stack starts with the command line arguments on it. Let's call the arguments `a` and `b`.
The first part, `.:+&`, essentially duplicates the stack, leaving it as `a, b, a, b`. `>` pushes 0 to the stack (it is part of a numeric literal completed by `9`).
`#` switches to 2D semantics, and `v` redirects the IP downwards. The IP immediately runs into a `#`, which switches back to 1D semantics again.
`9-!` checks whether `b` is equal to 9 (by subtracting 9 and taking the logical NOT). `\>6-!` then checks whether `a` is equal to 6. The stack now contains `a, b, 1, 1` if and only if `b==9` and `a==6`. Multiplying with `*` takes the logical AND of these two values, giving `a, b, 1` if the inputs were `6` and `9`, and `a, b, 0` otherwise.
After this, the IP runs into a `?`. This will switch to 2D mode if the top stack value is nonzero, and otherwise will continue in 1D mode.
If the top stack value was `1`, this means that the other stack values are `6` and `9`, so we push 42 to the stack with `>42` and then move down to the second `#` on the last line.
If the top stack value was `0`, then execution moves down to the next line. `d` removes the `0` (as `?` does not do so), and then we multiply the two inputs with `*`. The `##` switches in and out of 2D mode, doing nothing.
The branches have now joined again. The stack either contains `6, 9, 1, 42`, or `a*b`. `p` prints the top stack value and then the program ends, discarding the rest of the stack.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~13~~ ~~11~~ 12 bytes
```
¥6&V¥9?42:N×
```
[Try it online](http://ethproductions.github.io/japt/?v=1.4.5&code=pTYmVqU5PzQyOk7X&input=Niw5)
* ~~2~~ 1 bytes saved thanks to obarakon.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~36~~ 33 bytes
```
lambda x,y:42if x==6==y-3else x*y
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaFCp9LKxCgzTaHC1tbM1rZS1zg1pzhVoUKr8n9BUWZeiUaahpmOpaYmF4xnqWOmqfkfAA "Python 3 – Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 10 bytes
```
×-12×6 9≡,
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///v@JR24TD03UNjQ5PN1OwfNS5UOf/fwOFCgVjLiMgacplCSQNDbkMQWKGBlyWIL4RWNSMywxIWgIA "APL (Dyalog Unicode) – Try It Online")
`×` the product (of the arguments)
`-` minus
`12×` twelve times
`6 9≡` whether (6,9) is identical to
`,` the concatenation (of the arguments)
[Answer]
**R, 41 I think** I don't know how to count bytes I am new :D
```
function(a,b){
if(a==6&b==9){42} else {a*b}
}
```
I define a funtion whose arguments are a and b **in this order**. If a equals to 6 and b equals to 9 it returns 42, otherwise, a times b 
[Answer]
## [SPL](http://shakespearelang.sourceforge.net/report/shakespeare/#SECTION00053000000000000000), 356 bytes
```
a.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Ajax:Listen to your heart!Puck:Listen to your heart!Are you as big as the sum of a big big big cat and a cat?If so, am I as big as the sum of a big big cat and a big cat?If so, you are as big as the product of I and the sum of I and a cat.If not, you are as big as the product of you and I.Open your heart
```
With newlines and spaces:
```
a.                       *Title*
Ajax,.                   *Declare variable Ajax*
Puck,.                   *Declare variable Puck*
Act I:.
Scene I:.
[Enter Ajax and Puck]
Ajax: Listen to your heart!                  *Set Puck's value to user input*
Puck: Listen to your heart!                  *Set Ajax's value to user input*
      Are you as big as the sum of a big 
       big big cat and a cat?                *Is Ajax=9?* 
      If so, am I as big as the sum of a 
       big big cat and a big cat?            *Is Puck=6?* 
      If so, you are as big as the product 
       of I and the sum of I and a cat.      *If so, set Ajax=42* 
      If not, you are as big as the product 
       of you and I.                         *If not set Ajax=(Ajax)(Puck)*
      Open your heart                        *Print Ajax's value*
```
[Answer]
# [Standard ML (MLton)](http://www.mlton.org/), ~~22~~ 20 bytes
Saved 2 bytes thanks to @Laikoni!
```
fun$6 $9=42| $x y=x*y
```
[Try it online!](https://tio.run/##Jc2xCoMwFEbhV/mRDEmoUlMpFLG7c4cObQeRVAW9CXoFhb57mtLpWw6cZRrTaWRHIbxXEmdcqsJ8IDbs1ab3UMLPAzHkjaNd1jpqG74P3CN5UgI5NR6yJs7Y/RMFqVGTXxmdswt6O1uk6RVaPSAQD4dIAXP8mecwp5dSZfgC "Standard ML (MLton) – Try It Online")
This is the kind of thing SML is meant for, which is why it beats shortC and Python.
The old version looked much nicer. :P
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
c69∧42|×
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/qG3Do6bGh1snlP9PNrN81LHcxKjm8PT//6OjjXSMY3WijXWMgKSZjiWQtNQxA7EtdQyAlIGOGVjMTMcQSBnpmMbGAgA "Brachylog – Try It Online")
A predicate which takes a pair of numbers as its input variable and outputs their correct product through its output variable.
```
            If the input
c           concatenated
 69         is 69,
   ∧42      then output 42,
      |     otherwise
       ×    output the product of all numbers in the input.
```
I have no clue why `[0,69]c69` fails, but I am very glad that it does! (Running `69~cᶠw` confirms that `[6,9]` is the only two-element list that concatenates to `69`.)
[Answer]
# Python 3, 33 bytes
```
lambda x,y:42*(x==6)*(y==9)or x*y
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaFCp9LKxEhLo8LW1kxTS6PS1tZSM79IoUKr8n9BUWZeiUaahpmOpaYmF4xnqWOmqfkfAA "Python 3 – Try It Online")
[Answer]
## Pascal, 69 characters
```
function p(x,y:integer):integer;begin p:=x*y-12*ord(x=6)*ord(y=9)end;
```
expanded
```
function product(x, y: integer): integer;
begin
    product := x * y - 12 * ord(x = 6) * ord(y = 9)
end;
```
[Answer]
# Pyth, 12 bytes
```
-*FQ*12q(6 9
```
[Try it online](http://pyth.herokuapp.com/?code=-*FQ*12q%286%209&input=6%2C9&debug=0)
Explanation
```
 -*FQ*12q(6 9
  *FQ             Take the product
        q(6 9)Q   Check if the (implicit) input is (6, 9)
 -   *12          If so, subtract 12
```
[Answer]
# Bash, 24
```
echo $[$1$2-69?$1*$2:42]
```
Saves a couple of bytes by just doing one test - checking if the string concatenation of the inputs is 69.
[Try it online](https://tio.run/##NcuxCoAgFEbhvaf4kTsFDpoI1tCDRIPpDVsU0vc3l87wbefyNfW7vGhcW/CV8WQIBS0gFpihhRs6WLEhlgmjyg1Sgv6nc0gFdJAiLa3bSc2kV6PPHkvm/gE).
[Answer]
# [Retina](https://github.com/m-ender/retina), 36 bytes
```
^6 9$
6 7
\d+
$*
1(?=1* (1+))|.
$1
1
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP85MwVKFy0zBnCsmRZtLRYvLUMPe1lBLQcNQW1OzRo9LxZDL8P9/SwUzoBpLAA "Retina – Try It Online") Standard unary multiplication, just alters the input to handle the special case.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
⁼6,9ȧ42ȯ⁸P
```
A monadic link taking a list of the two numbers.
**[Try it online!](https://tio.run/##y0rNyan8//9R4x4zHcsTy02MTqx/1Lgj4P///9FAgVgA)**
### How?
```
⁼6,9ȧ42ȯ⁸P - Link: list of numbers [a,b]
 6,9       - 6 paired with 9, [6,9]
⁼          - equals? (non-vectorising) (1 or 0)
     42    - literal answer, 42
    ȧ      - logical and               (42 or 0)
        ⁸  - link's left argument, [a,b]
       ȯ   - logical or                (42 or [a,b])
         P - product                   (42 or a*b)
```
]