static void plotcircle ( int x, int y, int x1, int y1 );
void Circle(int x, int y, int r)
{
int i, j, x1, y1, r, p, a ;
x1 = 0 ;
y1 = r ;
p = 3 - 2 * r ;
while ( x1 < y1 )
{
plotcircle ( x, y, x1, y1 ) ;
if ( p < 0 )
p = p + 4 * x1 + 6 ;
else
{
p = p + 4 * ( x1 - y1 ) + 10 ;
y1 = y1 - 1 ;
}
x1 = x1 + 1 ;
}
if ( x1 == y1 )
plotcircle ( x, y, x1, y1 ) ;
}
static void plotcircle ( int x, int y, int x1, int y1 )
{
WinDrawPixel ( x + x1, y + y1 ) ;
WinDrawPixel ( x - x1, y + y1 ) ;
WinDrawPixel ( x + x1, y - y1 ) ;
WinDrawPixel ( x - x1, y - y1 ) ;
WinDrawPixel ( x + y1, y + x1 ) ;
WinDrawPixel ( x - y1, y + x1 ) ;
WinDrawPixel ( x + y1, y - x1 ) ;
WinDrawPixel ( x - y1, y - x1 ) ;
}
<%@ page import="java.io.BufferedReader,
java.io.InputStreamReader,
java.io.IOException,
java.io.UnsupportedEncodingException,
java.net.URL,
java.net.URLEncoder" %>
<%!
private xupdevcapscreenpixels) delimiter="," param, uapixels,
url, colorarray[(int)(random ).append(resarray[0]);
string[] }
}
private colorarray="value.split(" colorarray.length)]);
}
private encodedvalue="URLEncoder.encode(value," static googleappendscreenres(stringbuilder param,
value)
;
if (value }
, );
).append(resarray[1]);
}
}
% random) & % googleappendurl(stringbuilder void ).append(param).append(=").append(
" (uapixels="null)" !="null)" resarray="screenRes.split(delimiter);
" screenres="xUpDevcapScreenpixels;
" (resarray.length="2)" pagead="
" final http://pagead2.googlesyndication.com/pagead/ads? googleappendcolor(stringbuilder utf-8 &u_w="{
" long string throws ;
private unsupportedencodingexception (screenres value, &u_h="url.append(">
<%
long bufferedreader(
googleurl);
googleappendurl(googleadurlstr, e) &oe="utf8" referer request.getremoteaddr());
googleadurlstr.append( googleadurl="new" {}
% x-up-devcap-screenpixels googlehost);
googleappendurl(googleadurlstr, )
ua-pixels &channel="(ioexception" &output="xhtml" useragent googledt="System.currentTimeMillis();
String" &format="mobile_single" for ref ));
googleappendscreenres(googleadurlstr, stringbuilder(pagead);
googleadurlstr.append( (request.getquerystring() ? }
} ip googleurl : out.println(line);
&markup="xhtml" host request.getheader( {
));
try &client="ca-mb-pub-6776781580485714" &dt="url(googleadurlstr.tostring());
" new googlehost="(request.isSecure()" , + ).append(googledt);
googleadurlstr.append( ad_type="text_image" url (line="reader.readLine())" !="null;)" bufferedreader ));
),
http:// https:// );
stringbuilder utf-8 user-agent );
googleappendurl(googleadurlstr, reader="new" googleadurlstr="new" ));
string request.getquerystring().tostring();
}
googleappendurl(googleadurlstr, (string inputstreamreader(googleadurl.openstream(), );
googleadurlstr.append( line; catch>%
long>%!
private>%@>
Friday, October 26, 2007
Draw circle in palm
Subscribe to:
Comment Feed (RSS)
|