Compose Functions

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Read in function definitions, then make nested calls with the given input and output the result.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

a(x) = x + 2
b(x) = x * 2
a(b(3))
b(a(3))

Sample output:

8
10

Sample input:_

a(x) = x * 4
b(x) = x - 6
c(x) = x + 7
d(x) = x + 3
e(x) = x - 7
f(x) = x * 1
g(x) = x * 8
h(x) = x + 5
i(x) = x * 5
j(x) = x + 2
k(x) = x - 3
l(x) = x - 1
m(x) = x - 9
n(x) = x - 7
o(x) = x + 4
p(x) = x + 2
q(x) = x + 4
r(x) = x - 5
s(x) = x * 4
t(x) = x + 6
u(x) = x - 2
v(x) = x + 9
w(x) = x * 3
c(n(9))
a(t(q(m(5))))
l(j(a(v(5))))
m(e(4))
m(k(3))
j(k(i(7)))
h(d(7))
t(r(4))
r(m(a(w(5))))
n(q(6))
j(d(2))
t(f(k(2)))
l(m(d(g(7))))
w(p(i(n(3))))
v(w(h(e(4))))
e(b(c(r(4))))
u(p(e(n(7))))
o(a(b(h(3))))
m(i(e(u(1))))
u(q(e(t(2))))
t(m(q(o(2))))
j(m(r(5)))
u(w(f(a(1))))

Sample output:

9
24
57
-12
-9
34
15
5
46
3
7
5
49
-54
15
-7
-7
12
-49
3
7
-7
10

Sample input:_

a(x) = x * 3
b(x) = x + 1
a(a(a(a(a(a(a(b(b(b(b(b(b(1)))))))))))))
a(b(a(b(a(b(a(b(a(b(a(b(a(b(2))))))))))))))

Sample output:

15309
7653

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1mitchs450.03712015/05/08 07:18:300B / 19B / 22B
2Histocrat450.03722015/05/15 01:38:490B / 19B / 22B
3kaki460.03462015/05/21 03:07:170B / 19B / 23B
4Histocrat (author)470.04792015/05/08 03:24:180B / 19B / 24B

Perl _

RankUserSizeTimeDateStatistics
1mitchs500.03592015/05/10 14:58:480B / 23B / 24B
2tails520.03912015/05/08 18:56:100B / 24B / 24B
3teebee530.03722015/05/09 02:01:470B / 24B / 27B
4angel550.03392015/05/21 20:02:150B / ?B / ?B
5jonathan camacho750.03462015/05/08 12:22:360B / 25B / 45B
6BioFALSE800.03332015/05/15 02:44:330B / 27B / 50B
7%20950.03512015/05/08 12:54:000B / 34B / 56B

Python _

RankUserSizeTimeDateStatistics
1mitchs710.09942015/05/08 11:29:050B / 39B / 27B
2Hendrik710.08832015/05/08 12:20:230B / 40B / 27B
3rolf710.08742015/05/10 00:57:250B / 34B / 33B
4llhuii710.09342015/05/21 01:02:200B / ?B / ?B
5hallvabo710.09702015/05/22 01:31:110B / 34B / 34B
6xsot760.12302015/05/16 21:49:080B / 43B / 29B
7recursive780.10542015/05/15 05:21:060B / 49B / 21B

Python3 _

RankUserSizeTimeDateStatistics
1mitchs710.17052015/05/15 00:27:070B / 36B / 29B
2hallvabo710.26712015/05/22 01:59:480B / 31B / 37B

JavaScript _

RankUserSizeTimeDateStatistics
10mg640.04882015/05/20 22:04:490B / 38B / 26B
2FizzyTea640.04492015/05/21 01:39:500B / 38B / 25B

Lua _

RankUserSizeTimeDateStatistics
1Hendrik1120.03832015/05/12 03:42:060B / 65B / 44B

C _

RankUserSizeTimeDateStatistics
1smkt2130.03182016/05/08 04:13:020B / 108B / 101B

Bash _

RankUserSizeTimeDateStatistics
1tails100.03942015/05/09 23:29:550B / 5B / 5B
2teebee100.05352015/05/10 17:50:530B / 4B / 6B
3mitchs110.04072015/05/08 20:23:040B / 6B / 3B

Zsh _

RankUserSizeTimeDateStatistics
1teebee100.07552015/05/10 17:51:190B / 4B / 6B
2mitchs110.05222015/05/08 20:26:160B / 6B / 3B

Fish _

RankUserSizeTimeDateStatistics
1teebee100.08832015/05/10 17:53:480B / 5B / 5B
2mitchs110.09402015/05/08 20:26:250B / 6B / 3B

R _

RankUserSizeTimeDateStatistics
1Vlo (no golf)2380.42302015/05/21 06:59:450B / ?B / ?B

GolfScript _

RankUserSizeTimeDateStatistics
1tails400.08382015/05/09 23:53:370B / 5B / 35B

Vim _

RankUserSizeTimeDateStatistics
1FizzyTea200.11802015/05/18 22:02:412B / 9B / 6B
2FizzyTea(tails)150.08772015/05/24 22:18:230B / 8B / 6B

goruby _

RankUserSizeTimeDateStatistics
1mitchs400.10402015/05/09 01:58:230B / 16B / 21B

Language Ranking_

RankLangUserSizeScore
1Bashtails1010000
2Zshteebee1010000
3Fishteebee1010000
4VimFizzyTea(tails)156666
5gorubymitchs402500
6GolfScripttails402500
7Rubymitchs452222
8Perlmitchs502000
9JavaScript0mg641562
10Pythonmitchs711408
11Python3mitchs711408
12LuaHendrik112892
13Csmkt213469
14RVlo (no golf)238420

return to the top page