HOME
ABOUT GCS
INTERFACE
DESCRIPTION
EXAMPLES

Examples of the Dialogue Interface


Hello,(Your Name)!


 
<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Put your name in the box and press the "Compute" button.
<input type=TEXT name="World"><br>
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF>
int main()
{
 printf("Hello,World!\n");
}

</textarea><br>
</form>

  Try this example


Fahrenheit-Celsius Conversion


 
<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Put temperature value in the box, 
<br>select the conversion direction
<br>and press the "Compute" button.
<input type=TEXT name="TEMPE"><br>
<input type=RADIO name="CONV" value="1">Convert F to C<br>
<input type=RADIO name="CONV" value="2">Convert C to F<br>
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF>
int main()
{
 double t,tc;
 int c;

 t=TEMPE;
 c=CONV;
 if(c==1)
  tc=(t-32.)*5./9.;
 else
  tc=t*9./5.+32.;
 printf("Converted value:%6.2f\n",tc);
}
</textarea>
</form>

   
Try this example
 


Function Plotter


 
<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Put a right-hand side of an equasion containing parameter x in the box<br>
<input type=TEXT name="EQUA" value="sin(x)"><br>
Put the start value of the range of x<br>
<input type=TEXT name="STRT" value="0."><br>
Put the finish value of the range of x<br>
<input type=TEXT name="FNSH" value="3.1415"><br>
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF>
int main()
{
 double x,y,x0,x1,x2,dx,y0,y1;

 MakeView(300,200);
 SetColor(100,100,70);
 OpenPoly();
 MoveTo(50,30);
 LineTo(50,160);
 LineTo(280,160);
 LineTo(280,30);
 ClosePoly();
 MakeGraph(50,30,280,160);
 SetColor(0,0,0);
 x0=STRT;
 x1=FNSH;
 dx=(x1-x0)/10.;
 y0=1000.;
 y1=-1000.;
 x2=1.05*x1;
 for(x=x0;x<x2;x=x+dx){
  y=EQUA;
  if(y<y0) y0=y;
  if(y>y1) y1=y;
 }
 HorizScale("x-axis",x0,x1);
 VertScale("y-axis",y0,y1);
 SetColor(80,0,0);
 x=x0;
 MoveToG(x,EQUA);
 for(x=x0+dx;x<x2;x=x+dx){
  y=EQUA;
  LineToG(x,y);
 }
 SetColor(0,0,100);
 FontInfo(22,0,0);
 MoveTo(30,25);
 DrawString("y=EQUA");
 GifOut();
}

</textarea>
</form>

   
Try this example

 



DIALOGUE EXAMPLES
MORE EXAMPLES