ClearAll["Global`*"];
f[x_]=(1/((∏_(i=-2)^2)(x+i)));

b=1;
c=2;
d=1;

dir="-";
variar := Module[{},
 b=-b;

c= RandomInteger[{-2, 2}];
d=-d;
lim = Limit[ b* f[x],x->c,Direction->d];
Return[];
];


Manipulate[ 
If[d==1, dir ="-", dir="+"];
Dynamic@Plot[b* f[x],{x,-5,5},PlotRange->{{-2.5,5},{-1,1}},PlotStyle->{Thick},BaseStyle->{FontSize->12},Exclusions->Table[x==i, {i, -2, 2}],ExclusionsStyle->Directive[Red,Dashed]]
,
 Dynamic@Button["Calcule Lim f(x) cuando "<>"x->"<>ToString[c]<>dir,"", Appearance->"Frameless" ],

 Button["Respuesta",  CreateDialog[{TextCell[Limit[ b* f[x],x->c,Direction->d]],DefaultButton[]}];
  ],
Dynamic@Button["Nuevo ejercicio", variar ]

]

Autores: Juan Félix Ávila Herrera y Enrique Vílchez Quesada, Escuela de Informática, Universidad Nacional de Costa Rica,  .