Function Identification Game

(*12 functions are given so far*)
RandomKsublist[set_,k_]:=Module[{sub={},rest=set,new},Do[new=rest[[RandomInteger[{1,Length[rest]}]]];sub=AppendTo[sub,new];rest=Complement[rest,{new}],{k}];sub];
Randompermut[k_]:=RandomKsublist[Range[k],k];oznake={"a","b","c","d","e","f","g","h","i","j","k","l"};
Inversepermut[permut_]:=Flatten[Table[Position[permut,i],{i,1,Length[permut]}]];
funkcije={{Sin,ArcSin,{-Pi/4,Pi/2}//N,{Sin[-Pi/4],Sin[Pi/2]}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1,-.5,.5,1}}},{-Sin[#]&,-ArcSin[#]&,{-Pi/4,Pi/2}//N,{Sin[-Pi/2],Sin[Pi/4]}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1,-.5,.5,1}}},{If[-.5≤#&&#<=1,#^3,0]&,If[-0.5<=#<=0,-(-#)^(1/3),If[0≤#&&#≤1,#^(1/3),0]]&,{-.5,1},{(-.5)^3,1},{{-1,-0.5,.5,1},{-1,-0.5,.5,1}}},{If[-0.5<=#<=0,2#,If[0≤#&&#≤1,#]]&,If[-1<=#<=0,#/2,If[0≤#&&#≤1,#]]&,{-.5,1},{-1,1},{{-1,-0.5,.5,1},{-1,-0.5,.5,1}}},{If[-1<=#<=0,#/2,If[0≤#&&#≤1,#]]&,If[-0.5<=#<=0,2#,If[0≤#&&#≤1,#]]&,{-1,1},{-.5,1},{{-1,-0.5,.5,1},{-1,-0.5,.5,1}}},{Cos,ArcCos,{0,3Pi/4}//N,{Cos[3Pi/4],Cos[0]}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{ArcCos,Cos,{Cos[3Pi/4],Cos[0]}//N,{0,3Pi/4}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{ArcTan,Tan,{Tan[-Pi/4],Tan[Pi/3]}//N,{-Pi/4,Pi/3}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{Tan,ArcTan,{-Pi/4,Pi/3}//N,{Tan[-Pi/4],Tan[Pi/3]}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{-Tan[#]&,-ArcTan[#]&,{-Pi/4,Pi/3}//N,{Tan[-Pi/3],Tan[Pi/4]}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{-ArcTan[#]&,-Tan[#]&,{Tan[-Pi/3],Tan[Pi/4]}//N,{-Pi/4,Pi/3}//N,{{-1.5,-1,-.5,.5,1,1.5},{-1.5,-1,-.5,.5,1,1.5}}},{If[-1<=#<=0,-#,If[0≤#&&#≤1,-#/4]]&,If[-0.25<=#<=0,-4#,If[0≤#&&#≤1,-#]]&,{-1,1},{-.25,1},{{-1,-0.5,.5,1},{-1,-0.5,.5,1}}}};

Manipulate[With[{per2=Inversepermut[per]},With[{fun=funkcije[[i]]},With[{f0=fun[[1]]},With[{f1=fun[[2]],f2=f0[#-1]&,f3=Abs[f0[#]]&,f4=f0[Abs[#]]&,f5=f0[-#]&,f6=f0[#/2]&,f7=f0[2#]&,f8=f0[#+1]&,f9=-f0[#]&,f10=-f0[-#]&,f11=f0[#]+.5&,deff0=fun[[3]],zalf0=fun[[4]]},With[{deff1=zalf0,deff2=deff0+{1,1},
zalf2=zalf0,
zalf1=deff0,deff3=deff0,
zalf3={0,Max[Abs[zalf0]]},deff4={-deff0[[2]],deff0[[2]]},deff5={-deff0[[2]],-deff0[[1]]},
zalf5={Min[f0[deff0[[1]]],f0[deff0[[2]]]],Max[f0[deff0[[1]]],f0[deff0[[2]]]]},deff6=2 deff0,
zalf6=zalf0,deff7=(deff0/2),
zalf7=zalf0,deff8=deff0-{1,1},
zalf8=zalf0,deff9=deff0,
zalf9=-{zalf0[[2]],zalf0[[1]]},deff10=-{deff0[[2]],deff0[[1]]},
zalf10=-{zalf0[[2]],zalf0[[1]]},deff11=deff0,
zalf11=zalf0+(({1,1})/2)},With[{zalf4={Min[f0[0],f0[deff4[[2]]]],Max[f0[0],f0[deff4[[2]]]]}},With[{

plotR0={deff0,zalf0}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR1={deff1,zalf1}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR2={deff2,zalf2}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR3={deff3,zalf3}+{{-0.2`,0.2`},{-0.2`,0.2`}},plotR4={deff4,zalf4}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR5={deff5,zalf5}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR6={deff6,zalf6}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR7={deff7,zalf7}+{{-0.2`,0.2`},{-0.2`,0.2`}},plotR8={deff8,zalf8}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR9={deff9,zalf9}+{{-0.2`,0.2`},{-0.2`,0.2`}},plotR10={deff10,zalf10}+{{-0.2`,0.2`},{-0.2`,0.2`}},
plotR11={deff11,zalf11}+{{-0.2`,0.2`},{-0.2`,0.2`}}},With[{
g0=Plot[Evaluate[f0[x]],{x,deff0[[1]],deff0[[2]]},PlotRange->plotR0,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},GridLines->If[help,None,Automatic],Axes->True,Background->If[a0==oznake[[Inversepermut[per][[1]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[1]]]]],
g1=Plot[Evaluate[f1[x]],{x,deff1[[1]],deff1[[2]]},PlotRange->plotR1,AspectRatio->Automatic,Ticks->fun[[5]],GridLines->Automatic,PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,Background->If[a1==oznake[[Inversepermut[per][[2]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[2]]]]],
g2=Plot[Evaluate[f2[x]],{x,deff2[[1]],deff2[[2]]},PlotRange->plotR2,AspectRatio->Automatic,Ticks->fun[[5]],AxesOrigin->{0,0},GridLines->Automatic,PlotStyle->{Thickness[0.02`]},Axes->True,Background->If[a2==oznake[[Inversepermut[per][[3]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[3]]]]],
g3=Plot[Evaluate[f3[x]],{x,deff3[[1]],deff3[[2]]},PlotRange->plotR3,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a3==oznake[[Inversepermut[per][[4]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[4]]]]],
g4=Plot[Evaluate[f4[x]],{x,deff4[[1]],deff4[[2]]},PlotRange->plotR4,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a4==oznake[[Inversepermut[per][[5]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[5]]]]],
g5=Plot[Evaluate[f5[x]],{x,deff5[[1]],deff5[[2]]},PlotRange->plotR5,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a5==oznake[[Inversepermut[per][[6]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[6]]]]],
g6=Plot[Evaluate[f6[x]],{x,deff6[[1]],deff6[[2]]},PlotRange->plotR6,AspectRatio->Automatic,GridLines->Automatic,Ticks->{{-1,-0.5`,0.5`,1},{-1,-0.5`,0.5`,1}},PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,Background->If[a6==oznake[[Inversepermut[per][[7]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],Background->If[a6==oznake[[Inversepermut[per][[7]]]],GridLines->Automatic,RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[7]]]]],
g7=Plot[Evaluate[f7[x]],{x,deff7[[1]],deff7[[2]]},PlotRange->plotR7,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a7==oznake[[Inversepermut[per][[8]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[8]]]]],
g8=Plot[Evaluate[f8[x]],{x,deff8[[1]],deff8[[2]]},PlotRange->plotR8,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a8==oznake[[Inversepermut[per][[9]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[9]]]]],
g9=Plot[Evaluate[f9[x]],{x,deff9[[1]],deff9[[2]]},PlotRange->plotR9,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a9==oznake[[Inversepermut[per][[10]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[10]]]]],
g10=Plot[Evaluate[f10[x]],{x,deff10[[1]],deff10[[2]]},PlotRange->plotR10,AspectRatio->Automatic,Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},AxesOrigin->{0,0},Axes->True,GridLines->Automatic,Background->If[a10==oznake[[Inversepermut[per][[11]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[11]]]]],
g11=Plot[Evaluate[f11[x]],{x,deff11[[1]],deff11[[2]]},PlotRange->plotR11,AspectRatio->Automatic,AxesOrigin->{0,0},Ticks->fun[[5]],PlotStyle->{Thickness[0.02`]},Axes->True,GridLines->Automatic,Background->If[a11==oznake[[Inversepermut[per][[12]]]],RGBColor[0.215686, 1, 0.411765],RGBColor[1, 0.666667, 0.333333]],PlotLabel->oznake[[per2[[12]]]]]},With[{
gar={g0,g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11}[[per]]},cc[[1]]=(a0==oznake[[per[[1]]]]);Pane[Row[{
GraphicsGrid[Partition[gar,4],Frame->All,ImageSize->500]}],
{510,430},ImageSizeAction->"ShrinkToFit"
]
]
]
]
]
]]]]],
Dynamic@Grid[Transpose[{{Control[{{a0,0,"f(x)"},oznake}],
Control[{{a1,0,"(f^(-1))(x)"},oznake}],
Control[{{a2,0,"f(x-1)"},oznake}],
Control[{{a3,0,"| f(x) |"},oznake}],
Control[{{a4,0,"f( | x | )"},oznake}],
Control[{{a5,0,"f(-x)"},oznake}],
Control[{{a6,0,"f(x/2)"},oznake}],
Control[{{a7,0,"f(2x)"},oznake}],
Control[{{a8,0,"f(x+1)"},oznake}],
Control[{{a9,0,"-f(x)"},oznake}],
Control[{{a10,0,"-f(-x)"},oznake}],
Control[{{a11,0,"f(x)+1/2"},oznake}]},cc={If[a0==0,"????",a0==oznake[[Inversepermut[per][[1]]]]],If[a1==0,"????",a1==oznake[[Inversepermut[per][[2]]]]],If[a2==0,"????",a2==oznake[[Inversepermut[per][[3]]]]],If[a3==0,"????",a3==oznake[[Inversepermut[per][[4]]]]],If[a4==0,"????",a4==oznake[[Inversepermut[per][[5]]]]],If[a5==0,"????",a5==oznake[[Inversepermut[per][[6]]]]],If[a6==0,"????",a6==oznake[[Inversepermut[per][[7]]]]],If[a7==0,"????",a7==oznake[[Inversepermut[per][[8]]]]],If[a8==0,"????",a8==oznake[[Inversepermut[per][[9]]]]],If[a9==0,"????",a9==oznake[[Inversepermut[per][[10]]]]],If[a10==0,"????",a10==oznake[[Inversepermut[per][[11]]]]],If[a11==0,"????",a11==oznake[[Inversepermut[per][[12]]]]]}}]],
{{help,False,"show f(x)"},{False,True}},
{{per,Randompermut[12]},ControlType->None},
{i,RandomInteger[{1,12}],ControlType->None},
{cc,Table["?",{12}],ControlType->None},
Button["new example",per=Randompermut[12];
a0=0;a1=0;a2=0;a3=0;a4=0;a5=0;a6=0;a7=0;a8=0;a9=0;
i=RandomInteger[{1,12}];
a10=0;a11=0],
AutorunSequencing->{1,3,5,7},
SaveDefinitions->True,ControlPlacement->Left]

This Demonstration asks you to identify 12 function plots. For each function find the label of its plot.

Contributed by: Izidor Hafner