5 saved 1 byte on the 2nd version
source | link

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 8080 79 bytes

Saved 1 byte thanks to @ETHproductions

Takes input as an array of 2 integers and outputs a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+o'[(d<8?(x=a[d&1])>(d|1)):x&1]x)&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+o'[(d<8?(x=a[d&1])>(d|1)):x&1]x)&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and outputs a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`
---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 79 bytes

Saved 1 byte thanks to @ETHproductions

Takes input as an array of 2 integers and outputs a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[(d<8?(x=a[d&1])>(d|1):x)&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[(d<8?(x=a[d&1])>(d|1):x)&1])

console.log(f([4,2]))
console.log(f([3,7]))

4 fixed typo + minor update
source | link

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153
`153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+` 
---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153
`153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+` 
---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and outputoutputs a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and output a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+` 
---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+` 
---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and outputs a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

3 saved 1 byte
source | link

JavaScript (ES6), 7979 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[+d?+o'[(+d?n>d):n&1]n)&1]))(a)+`---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[+d?+o'[(+d?n>d):n&1]n)&1]))(a)+`---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and output a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 bytes

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[+d?+(n>d):n&1]))(a)+`---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[+d?+(n>d):n&1]))(a)+`---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and output a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

JavaScript (ES6), 79 78 bytes

Saved 1 byte thanks to @ETHproductions

Takes input in currying syntax (a)(b) and outputs a vertical ASCII domino.

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`---
`+g(b)

Demo

let f =

a=>b=>(g=n=>`351
707
153
`.replace(/./g,d=>' o'[(+d?n>d:n)&1]))(a)+`---
`+g(b)

console.log(f(4)(2))
console.log(f(3)(7))


Horizontal version, 80 bytes

Takes input as an array of 2 integers and output a horizontal ASCII domino.

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

Demo

let f =

a=>`240|351
686|797
042|153`.replace(/\d/g,d=>' o'[d<8?+((x=a[d&1])>(d|1)):x&1])

console.log(f([4,2]))
console.log(f([3,7]))

2 added another version
source | link
1
source | link