1.htmlç±å¿çè±ä»£ç å¯å¤å¶ï¼
2.十款代码表白特效,烟花源码烟花一个比一个浪漫 2021-11-08 21:01·Java码农之路
3.çè±ä»£ç ç¼ç¨python(ç«ç°è±ä»£ç ç¼ç¨python)
htmlç±å¿çè±ä»£ç å¯å¤å¶ï¼
æ°å¹´ç¥ç¦è¯ä»£ç
æ°å¹´ç¥ç¦è¯ä»£ç æï¼
1ãç»èå¸çæ°å¹´ç¥ç¦ä»£ç ï¼2mylove.cn/tbjã
2ãç»ç¸ç¸çæ°å¹´ç¥ç¦ä»£ç ï¼2mylove.cn/tbhã
3ãç»å¦å¦çæ°å¹´ç¥ç¦ä»£ç ï¼2mylove.cn/tbiã
4ãç»æåçæ°å¹´ç¥ç¦ä»£ç ï¼2mylove.cn/t8mã
5ãæ°å¹´ç¥ç¦ä»£ç ï¼2mylove.cn/t9fã
6ãçè±ä»£ç ï¼2mylove.cn/agã
Cè¯è¨ä»£ç çç¨å¤ï¼
1ãCè¯è¨æ¯é«çº§è¯è¨ã
å®æé«çº§è¯è¨çåºæ¬ç»æåè¯å¥ä¸ä½çº§è¯è¨çå®ç¨æ§ç»åèµ·æ¥ãCè¯è¨å¯ä»¥åæ±ç¼è¯è¨ä¸æ ·å¯¹ä½ãåèåå°åè¿è¡æä½ï¼èè¿ä¸è æ¯è®¡ç®æºæåºæ¬çå·¥ä½åå ã
2ãCè¯è¨æ¯ç»æå¼è¯è¨ã
ç»æå¼è¯è¨çæ¾èç¹ç¹æ¯ä»£ç åæ°æ®çåéåï¼å³ç¨åºçå个é¨åé¤äºå¿ è¦çä¿¡æ¯äº¤æµå¤å½¼æ¤ç¬ç«ãè¿ç§ç»æåæ¹å¼å¯ä½¿ç¨åºå±æ¬¡æ¸ æ°ï¼ä¾¿äºä½¿ç¨ãç»´æ¤ä»¥åè°è¯ã
3ãCè¯è¨æ¯ä»¥å½æ°å½¢å¼æä¾ç»ç¨æ·çã
è¿äºå½æ°å¯æ¹ä¾¿çè°ç¨ï¼å¹¶å ·æå¤ç§å¾ªç¯ãæ¡ä»¶è¯å¥æ§å¶ç¨åºæµåï¼ä»è使ç¨åºå®å ¨ç»æåã
4ãCè¯è¨åè½é½å ¨ã
å ·æåç§åæ ·çæ°æ®ç±»åï¼å¹¶å¼å ¥äºæéæ¦å¿µï¼å¯ä½¿ç¨åºæçæ´é«ãèä¸è®¡ç®åè½ãé»è¾å¤æåè½ä¹æ¯è¾å¼ºå¤§ã
5ãCè¯è¨éç¨èå´å¤§ã
éåäºå¤ç§æä½ç³»ç»ï¼å¦WindowsãDOSãUNIXãLINUXççï¼ä¹éç¨äºå¤ç§æºåãCè¯è¨å¯¹ç¼åéè¦ç¡¬ä»¶è¿è¡æä½çåºåï¼ææ¾ä¼äºå ¶å®é«çº§è¯è¨ï¼æä¸äºå¤§ååºç¨è½¯ä»¶ä¹æ¯ç¨Cè¯è¨ç¼åçã
年跨年çè±ä»£ç
æ°å¹´ç¥ç¦ä»£ç ï¼2myloveï¼cn/agã代ç ï¼2myloveï¼cn/t9fãçè±ä»£ç ï¼ï¼csdnï¼net/u/article/details/ã表ç½ä»£ç ï¼2myloveï¼cn/agãæ°å¹´ç¥ç¦ä»£ç ï¼2myloveï¼cn/agã代ç ï¼2myloveï¼cn/t9fã代ç ï¼2myloveï¼cn/t8mã跨年å¦æèè³ï¼ç¥ç¦éç»ä½ ï¼ç¥ä½ æ°å¹´æ°æ°è±¡ï¼èº«ä½å¥åº·ï¼åè涨èªï¼ç活幸ç¦ï¼äººç¼å ³ç³»å¥½ï¼æåæ³ç¥ä½ ç¬å£å¸¸å¼ï¼ä¸äºå¦æãè±æµæçèçç±æç»äºè±èï¼éªè±æ绵绵çæ æç»äºå¤§å°ï¼æé³æä¸ä¸ç温æç»äºéå±±ï¼å¤é£æ温æçåå¿ç»äºææï¼å¤©å°ææç¾çèæ¥ç»äºæ¥èï¼æææççç¥ç¦ç»äºä½ ï¼ç¥ä½ æ¥èå¿«ä¹ã
htmlçè±ç¹æ代ç HTMLçè±ç¹æ代ç ï¼//çè±ä»£ç //...æå±ï¼ç½åï¼å°çè±
æå±ï¼å°çè±ï¼æçè±ç精彩æ´æ»¡æ¯ä¸ä¸ªè§è½ï¼æ欢ç¬ä¼ éå¿«ä¹çæ¯ä¸å»ï¼
年跨年çè±ä»£ç å¯å¤å¶çè±ä»£ç å¦ä¸ï¼
packagelove;
importjava.applet.Applet;
importjava.awt.Color;
importjava.awt.Graphics;
importjava.net.URL;
importjava.util.Random;
çè±
@authorenjoy
@SuppressWarnings("serial")
publicclassQextendsAppletimplementsRunnable
publicintspeed,代码variability,Max_Number,Max_Energy,Max_Patch,
Max_Length,G;
publicStringsound;
privateintwidth,height;
privateThreadthread=null;
privateBeaClassDemobcd[];
publicvoidinit()?
inti;
this.setSize(,);
width=getSize().width-1;
height=getSize().height-1;
speed=1;?//çè±ç»½æ¾çé度
variability=;
Max_Number=;?//å¯ååºçè±çæ大æ°ç®
Max_Energy=width+;
Max_Patch=;?//æ大çæç¹æ°
Max_Length=;?//æç¹çæ大è·ç¦»
G=;?//åå°é¢å¼¯æ²çå度
bcd=newBeaClassDemo[Max_Number];
for(i=0;iMax_Number;i++)
bcd[i]=newBeaClassDemo(width,height,G);
}
publicvoidstart(){
if(thread==null){
thread=newThread(this);
thread.start();
}
}
@SuppressWarnings("deprecation")
publicvoidstop(){
if(thread!=null){
thread.stop();
thread=null;
}
}
@SuppressWarnings({ "unused","static-access"})
publicvoidrun(){
inti;
intE=(int)(Math.random()*Max_Energy*3/4)+Max_Energy/4+1;
intP=(int)(Math.random()*Max_Patch*3/4)?//çè±çæç¹æ°
+Max_Patch/4+1;
intL=(int)(Math.random()*Max_Length*3/4)?//çè±å¯åå°åºçè·ç¦»
+Max_Length/4+1;
longS=(long)(Math.random()*);
booleansleep;
Graphicsg=getGraphics();
URLu=null;
while(true){
try{
thread.sleep(/speed);
catch(InterruptedExceptionx){
sleep=true;
for(i=0;iMax_Number;i++)
sleep=sleepbcd[i].sleep;
if(sleepMath.random()*variability){
E=(int)(Math.random()*Max_Energy*3/4)+Max_Energy/4
+1;
P=(int)(Math.random()*Max_Patch*3/4)+Max_Patch/4
+1;
L=(int)(Math.random()*Max_Length*3/4)+Max_Length/4
+1;
S=(long)(Math.random()*);
for(i=0;iMax_Number;i++){
if(bcd[i].sleepMath.random()*Max_Number*L1)
bcd[i].init(E,P,L,S);
bcd[i].start();
bcd[i].show(g);
publicvoidpaint(Graphicsg)?
g.setColor(Color.black);
g.fillRect(0,0,width+1,height+1);
classBeaClassDemo
publicbooleansleep=true;
privateintenergy,patch,length,width,height,G,Xx,Xy,Ex[],Ey[],x,
y,Red,Blue,Green,t;
privateRandomrandom;
publicBeaClassDemo(inta,intb,intg)
width=a;
height=b;
G=g;
publicvoidinit(inte,intp,intl,longseed)?
inti;
energy=e;
patch=p;
length=l;
//å建ä¸ä¸ªå¸¦ç§åçéæºæ°çæå¨
random=newRandom(seed);
Ex=newint[patch];
Ey=newint[patch];
Red=(int)(random.nextDouble()*)+;
Blue=(int)(random.nextDouble()*)+;
Green=(int)(random.nextDouble()*)+;
Xx=(int)(Math.random()*width/2)+width/4;
Xy=(int)(Math.random()*height/2)+height/4;
for(i=0;ipatch;i++){
Ex[i]=(int)(Math.random()*energy)-energy/2;
Ey[i]=(int)(Math.random()*energy*7/8)-energy/8;
publicvoidstart
t=0;
sleep=false;
publicvoidshow(Graphicsg)?
if(!sleep)
if(tlength)
inti,c;
doubles;
Colorcolor;
c=(int)(random.nextDouble()*)-+Red;
if(c=0c)
Red=c;
c=(int)(random.nextDouble()*)-+Blue;
if(c=0c)
Blue=c;
c=(int)(random.nextDouble()*)-+Green;
if(c=0c)
Green=c;
color=newColor(Red,Blue,Green);
for(i=0;ipatch;i++)
s=(double)t/;
x=(int)(Ex[i]*s);
y=(int)(Ey[i]*s-G*s*s);
g.setColor(color);
g.drawLine(Xx+x,Xy-y,Xx+x,Xy-y);
if(t=length/2)
intj;
for(j=0;j2;j++)
s=(double)((t-length/2)*2+j)/;
x=(int)(Ex[i]*s);
y=(int)(Ey[i]*s-G*s*s);
g.setColor(Color.black);
g.drawLine(Xx+x,Xy-y,Xx+x,Xy-y);
常ç¨çç¼ç¨è¯è¨ã
ç¼ç¨è¯è¨ä¸ï¼Cè¯è¨
Cè¯è¨æ¯ä¸çä¸ææµè¡ã使ç¨æ广æ³çé«çº§ç¨åºè®¾è®¡è¯è¨ä¹ä¸ãå¨æä½ç³»ç»åç³»ç»ä½¿ç¨ç¨åºä»¥åéè¦å¯¹ç¡¬ä»¶è¿è¡æä½çåºåï¼ç¨Cè¯è¨ææ¾ä¼äºå ¶å®é«çº§è¯è¨ï¼è®¸å¤å¤§ååºç¨è½¯ä»¶é½æ¯ç¨Cè¯è¨ç¼åçã
ç¼ç¨è¯è¨äº:java
Javaæ¯ä¸ç§å¯ä»¥æ°å跨平å°åºç¨è½¯ä»¶çé¢å对象çç¨åºè®¾è®¡è¯è¨ï¼æ¯ç±SunMicrosystemså ¬å¸äºå¹´5ææ¨åºçJavaç¨åºè®¾è®¡è¯è¨åJavaå¹³å°ï¼å³JavaSE,JavaEE,JavaMEï¼çæ»ç§°ã
ç¼ç¨è¯è¨ä¸:c++
C++è¿ä¸ªè¯å¨ä¸å½å¤§éçç¨åºåååä¸é常被读åâCå å âï¼è西æ¹çç¨åºåé常读åâCplusplus","CPPâãå®æ¯ä¸ç§ä½¿ç¨é常广æ³ç计ç®æºç¼ç¨è¯è¨ãC++æ¯ä¸ç§éææ°æ®ç±»åæ£æ¥çãæ¯æå¤éç¼ç¨èå¼çéç¨ç¨åºè®¾è®¡è¯è¨ã
年跨年çè±ä»£ç å¯å¤å¶è·¨å¹´çè±ä»£ç å¦ä¸ï¼
é«çº§ææ1ä¸è½½å°åï¼
跨年çè±+éªè±bbs.csdn.net/topics/
é«çº§ææ2ä¸è½½å°åï¼
跨年跳转çè±æåbbs.csdn.net/topics/
çè±ï¼å称è±ç®ãçç«ãç°ç«ï¼æ¯æ以çç«è¯ä¸ºåæï¼ç¨äºäº§ç声å è²ç娱ä¹ç¨åãä¸å½å³å¨äººæ°åæè¾æ©ï¼å¸¸ç¨äºç大çå ¸ç¤¼æ表æ¼ä¸ï¼èç°ä»£å¨å ¨ä¸å½ä»¥åå ¨ä¸çå¯ä¸è½å¨å天åæ´»å¨éæ½æ¾çè±çæ´»å¨å为跨年ï¼é¤å¤å¤ï¼æ´»å¨ã
为äºä¿æ¤ç¯å¢ï¼å¾å¤çè±é æ¹ä¸ä¸éç¨å«æééå±åç¡«å ç´ çç©è´¨ï¼åå°äºäºæ°§åç¡«åå ¶ä»ç¡«åç©ççæï¼è¿éè¿æ¹åæ°§åååå¯çç©çéæ¥æ¹åç³»ç»ç氧平衡åçç§æ¸©åº¦ï¼æ§å¶çç§ååºã
çè±åç竹çåºå«
çè±åç竹ç大åå°å¼ï¼å ¶ç»æé½å å«é»ç«è¯åè¯å¼ãç¹ççè±åï¼åå¦ååºå¼åçç¸ï¼èçç¸è¿ç¨ä¸æéæ¾åºæ¥çè½éï¼ç»å¤§é¨å转åæå è½åç°å¨äººä»¬ç¼ä¸ã
å¶ä½çè±çè¿ç¨ä¸å å ¥ä¸äºåå åååè²åè½å¤ä½¿çè±æ¾åºäºå½©ç¼¤çº·çé¢è²ãç°ç«è¦é£å¾é«ç¸å¾å¼ï¼æææä¼å¥½ãæ以ï¼çè±ä¸å¡«å äºå¤§éç¨äºåå°ä»¥åçç¸çç«è¯ï¼åªæè¿æ ·æè½è¾¾å°å¥½ç表æ¼ææã
çè±ä»£ç ææºå¯å¤å¶åå¯ä»¥ãçè±ä»£ç æ¯ä¸ä¸ªå¾å¥½çç代ç ï¼å¨ä»£ç 使ç¨æ¶ï¼ææºæ¯å¯å¤å¶çï¼è¯¥ä»£ç é常ç好çï¼æ·±å人们åç±ã
十款代码表白特效,一个比一个浪漫 -- :·Java码农之路
程序员,烟花源码烟花这个群体常常被与一系列标签相连,代码linux 源码编译驱动如“直率、烟花源码烟花宅、代码棋牌陌陌源码不浪漫、烟花源码烟花单调”,代码但这并不意味着他们缺乏情感表达。烟花源码烟花实际上,代码他们的烟花源码烟花专注与逻辑思维在浪漫时刻也能发挥独特魅力。 以雷军的代码名言为例,他热爱代码的烟花源码烟花免费源码汽车购买简单世界,这正是代码他们对待感情的认真态度。尽管程序员可能在日常生活中显得有些宅,烟花源码烟花但当感情需要表达时,主板 hdmi 源码输出他们能借助代码创造出意想不到的浪漫。比如,他们可以用编程语言绘制出玫瑰花和爱心,软件源码下载平台甚至打造网页上的爱心树和烟花,用代码语言说出深情的告白。代码表白实例
玫瑰花表白源码展示部分
爱心表白源码如下
网页爱心树表白部分代码展示
烟花和网页爱心表白源码展示
程序语言表白创意
程序语言表白一 程序语言表白二 程序语言表白三 程序语言表白四çè±ä»£ç ç¼ç¨python(ç«ç°è±ä»£ç ç¼ç¨python)
æ¾çè±ç代ç
#-*-coding:utf-8-*-importmath,random,timeimportthreadingimporttkinterastkimportreuuidFireworks=[]maxFireworks=8height,width=,classfirework(object):def__init__(self,color,speed,width,height):=uuid.uuid1()self.radius=random.randint(2,4)~4åç´ self.color=colorself.speed=speed.5-3.5ç§self.status=0ï¼status=0ï¼çç¸åï¼status=1ï¼å½statusæ¶ï¼çè±ççå½æç»æ¢self.nParticle=random.randint(,)self.center=[random.randint(0,width-1),random.randint(0,height-1)]self.oneParticle=[]ï¼%ç¶ææ¶ï¼self.rotTheta=random.uniform(0,2*math.pi)ï¼x=a*cos(theta),y=b*sin(theta)=[a,b]
pythonç«é ·çè±è¡¨ç½æºä»£ç æ¯å¤å°ï¼å¦å®æ¬æç¨åï¼ä½ ä¹è½ååºè¿æ ·ççè±ç§ã
å¦ä¸å¾ç¤ºï¼æ们è¿ééè¿è®©ç»é¢ä¸ä¸ä¸ªç²ååè£ä¸ºXæ°éçç²åæ¥æ¨¡æçç¸ææãç²åä¼åçï¼è¨èâï¼æææ¯å®ä»¬ä¼ä»¥æé移å¨ä¸ç¸äºä¹é´çè§åº¦ç¸çãè¿æ ·å°±è½è®©æ们以ä¸ä¸ªåå¤è¨èçååå½¢å¼æ¨¡æåºçè±ç»½æ¾çç»é¢ã
ç»è¿ä¸å®æ¶é´åï¼ç²åä¼è¿å ¥ï¼èªç±è½ä½âé¶æ®µï¼ä¹å°±æ¯ç±äºéåå ç´ å®ä»¬å¼å§å è½å°å°é¢ï¼ä»¿è¥ç»½æ¾åççççè±ã
åºæ¬ç¥è¯ï¼ç¨PythonåTkinter设计çè±ã
è¿éä¸åä¸è¡èææ°å¦ç¥è¯å ¨ä¸¢åºæ¥ï¼æ们边å代ç 边说ç论ãé¦å ï¼ç¡®ä¿ä½ å®è£ åå¯¼å ¥äºTkinterï¼å®æ¯Pythonçæ åGUIåºï¼å¹¿æ³åºç¨äºåç§åæ ·ç项ç®åç¨åºå¼åï¼å¨Pythonä¸ä½¿ç¨Tkinterå¯ä»¥å¿«éçå建GUIåºç¨ç¨åºã
importtkinterastk
fromPILimportImage,ImageTk
fromtimeimporttime,sleep
fromrandomimportchoice,uniform,randint
frommathimportsin,cos,radians
é¤äºTkinterä¹å¤ï¼ä¸ºäºè½è®©çé¢ææ¼äº®çèæ¯ï¼æ们ä¹å¯¼å ¥PILç¨äºå¾åå¤çï¼ä»¥åå¯¼å ¥å ¶å®ä¸äºå ï¼æ¯å¦timeï¼randomåmathãå®ä»¬è½è®©æ们æ´å®¹æçæ§å¶çè±ç²åçè¿å¨è½¨è¿¹ã
Tkinteråºç¨çåºæ¬è®¾ç½®å¦ä¸ï¼
root=tk.Tk()
为äºè½åå§åTkinterï¼æä»¬å¿ é¡»å建ä¸ä¸ªTk()æ ¹é¨ä»¶ï¼rootwidgetï¼ï¼å®æ¯ä¸ä¸ªçªå£ï¼å¸¦ææ é¢æ åç±çªå£ç®¡çå¨æä¾çå ¶å®è£ 饰ç©ãè¯¥æ ¹é¨ä»¶å¿ é¡»å¨æ们åå»ºå ¶å®å°é¨ä»¶ä¹åå°±å建å®æ¯ï¼èä¸åªè½æä¸ä¸ªæ ¹é¨ä»¶ã
w=tk.Label(root,text="HelloTkinter!")
è¿ä¸è¡ä»£ç å å«äºLabelé¨ä»¶ã该Labelè°ç¨ä¸ç第ä¸ä¸ªåæ°å°±æ¯ç¶çªå£çååï¼å³æ们è¿éç¨çï¼æ ¹âãå ³é®ååæ°ï¼textâæææ¾ç¤ºçæåå 容ãä½ ä¹å¯ä»¥è°ç¨å ¶å®å°é¨ä»¶ï¼Buttonï¼Canvasççã
w.pack()
root.mainloop()
æ¥ä¸æ¥çè¿ä¸¤è¡ä»£ç å¾éè¦ãè¿éçæå æ¹æ³æ¯åè¯Tkinterè°æ´çªå£å¤§å°ä»¥éåºæç¨çå°é¨ä»¶ãçªå£ç´å°æ们è¿å ¥Tkinteräºä»¶å¾ªç¯ï¼è¢«root.mainloop()è°ç¨æ¶æä¼åºç°ãå¨æä»¬å ³éçªå£åï¼èæ¬ä¼ä¸ç´å¨åçå¨äºä»¶å¾ªç¯ã
å°çè±ç»½æ¾è½¬è¯æ代ç
ç°å¨æ们设计ä¸ä¸ªå¯¹è±¡ï¼è¡¨ç¤ºçè±äºä»¶ä¸çæ¯ä¸ªç²åãæ¯ä¸ªç²åé½ä¼æä¸äºéè¦çå±æ§ï¼æ¯é äºå®çå¤è§å移å¨ç¶åµï¼å¤§å°ï¼é¢è²ï¼ä½ç½®ï¼é度ççã
跨年çè±ä»£ç ï½ç¨Pythonéä½ ä¸åºè·¨å¹´çè±ç§å·²ç»æ¥è¿å°¾å£°äºï¼å³å°å°æ¥ï¼æ¬ææ们ç¨Pythonéä½ ä¸åºè·¨å¹´çè±ç§ã
æ们ç¨å°çPython模åå æ¬ï¼tkinterãPILãtimeãrandomãmathï¼å¦æ第ä¸æ¹æ¨¡å没æè£ çè¯ï¼pipinstallä¸ä¸å³å¯ï¼ä¸é¢çä¸ä¸ä»£ç å®ç°ã
导åº
çè±é¢è²
å®ä¹çè±ç±»
çæ¾çè±
å¯å¨
çä¸ä¸ææï¼
年跨年çè±ä»£ç å¯å¤å¶
çè±ä»£ç å¦ä¸ï¼
packagelove;
importjava.applet.Applet;
importjava.awt.Color;
importjava.awt.Graphics;
importjava.net.URL;
importjava.util.Random;
çè±
@authorenjoy
@SuppressWarnings("serial")
publicclassQextendsAppletimplementsRunnable
publicintspeed,variability,Max_Number,Max_Energy,Max_Patch,
Max_Length,G;
publicStringsound;
privateintwidth,height;
privateThreadthread=null;
privateBeaClassDemobcd[];
publicvoidinit()
inti;
this.setSize(,);
width=getSize().width-1;
height=getSize().height-1;
speed=1;//çè±ç»½æ¾çé度
variability=;
Max_Number=;//å¯ååºçè±çæ大æ°ç®
Max_Energy=width+;
Max_Patch=;//æ大çæç¹æ°
Max_Length=;//æç¹çæ大è·ç¦»
G=;//åå°é¢å¼¯æ²çå度
bcd=newBeaClassDemo[Max_Number];
for(i=0;iMax_Number;i++)
bcd[i]=newBeaClassDemo(width,height,G);
}
publicvoidstart(){
if(thread==null){
thread=newThread(this);
thread.start();
}
}
@SuppressWarnings("deprecation")
publicvoidstop(){
if(thread!=null){
thread.stop();
thread=null;
}
}
@SuppressWarnings({ "unused","static-access"})
publicvoidrun(){
inti;
intE=(int)(Math.random()*Max_Energy*3/4)+Max_Energy/4+1;
intP=(int)(Math.random()*Max_Patch*3/4)//çè±çæç¹æ°
+Max_Patch/4+1;
intL=(int)(Math.random()*Max_Length*3/4)//çè±å¯åå°åºçè·ç¦»
+Max_Length/4+1;
longS=(long)(Math.random()*);
booleansleep;
Graphicsg=getGraphics();
URLu=null;
while(true){
try{
thread.sleep(/speed);
catch(InterruptedExceptionx){
sleep=true;
for(i=0;iMax_Number;i++)
sleep=sleepbcd[i].sleep;
if(sleepMath.random()*variability){
E=(int)(Math.random()*Max_Energy*3/4)+Max_Energy/4
+1;
P=(int)(Math.random()*Max_Patch*3/4)+Max_Patch/4
+1;
L=(int)(Math.random()*Max_Length*3/4)+Max_Length/4
+1;
S=(long)(Math.random()*);
for(i=0;iMax_Number;i++){
if(bcd[i].sleepMath.random()*Max_Number*L1)
bcd[i].init(E,P,L,S);
bcd[i].start();
bcd[i].show(g);
publicvoidpaint(Graphicsg)?
g.setColor(Color.black);
g.fillRect(0,0,width+1,height+1);
classBeaClassDemo
publicbooleansleep=true;
privateintenergy,patch,length,width,height,G,Xx,Xy,Ex[],Ey[],x,
y,Red,Blue,Green,t;
privateRandomrandom;
publicBeaClassDemo(inta,intb,intg)
width=a;
height=b;
G=g;
publicvoidinit(inte,intp,intl,longseed)?
inti;
energy=e;
patch=p;
length=l;
//å建ä¸ä¸ªå¸¦ç§åçéæºæ°çæå¨
random=newRandom(seed);
Ex=newint[patch];
Ey=newint[patch];
Red=(int)(random.nextDouble()*)+;
Blue=(int)(random.nextDouble()*)+;
Green=(int)(random.nextDouble()*)+;
Xx=(int)(Math.random()*width/2)+width/4;
Xy=(int)(Math.random()*height/2)+height/4;
for(i=0;ipatch;i++){
Ex[i]=(int)(Math.random()*energy)-energy/2;
Ey[i]=(int)(Math.random()*energy*7/8)-energy/8;
publicvoidstart
t=0;
sleep=false;
publicvoidshow(Graphicsg)
if(!sleep)?
if(tlength)
inti,c;
doubles;
Colorcolor;
c=(int)(random.nextDouble()*)-+Red;
if(c=0c)
Red=c;
c=(int)(random.nextDouble()*)-+Blue;
if(c=0c)
Blue=c;
c=(int)(random.nextDouble()*)-+Green;
if(c=0c)
Green=c;
color=newColor(Red,Blue,Green);
for(i=0;ipatch;i++)
s=(double)t/;
x=(int)(Ex[i]*s);
y=(int)(Ey[i]*s-G*s*s);
g.setColor(color);
g.drawLine(Xx+x,Xy-y,Xx+x,Xy-y);
if(t=length/2)
intj;
for(j=0;j2;j++)
s=(double)((t-length/2)*2+j)/;
x=(int)(Ex[i]*s);
y=(int)(Ey[i]*s-G*s*s);
g.setColor(Color.black);
g.drawLine(Xx+x,Xy-y,Xx+x,Xy-y);
常ç¨çç¼ç¨è¯è¨ã
ç¼ç¨è¯è¨ä¸ï¼Cè¯è¨
Cè¯è¨æ¯ä¸çä¸ææµè¡ã使ç¨æ广æ³çé«çº§ç¨åºè®¾è®¡è¯è¨ä¹ä¸ãå¨æä½ç³»ç»åç³»ç»ä½¿ç¨ç¨åºä»¥åéè¦å¯¹ç¡¬ä»¶è¿è¡æä½çåºåï¼ç¨Cè¯è¨ææ¾ä¼äºå ¶å®é«çº§è¯è¨ï¼è®¸å¤å¤§ååºç¨è½¯ä»¶é½æ¯ç¨Cè¯è¨ç¼åçã
ç¼ç¨è¯è¨äº:java
Javaæ¯ä¸ç§å¯ä»¥æ°å跨平å°åºç¨è½¯ä»¶çé¢å对象çç¨åºè®¾è®¡è¯è¨ï¼æ¯ç±SunMicrosystemså ¬å¸äºå¹´5ææ¨åºçJavaç¨åºè®¾è®¡è¯è¨åJavaå¹³å°ï¼å³JavaSE,JavaEE,JavaMEï¼çæ»ç§°ã
ç¼ç¨è¯è¨ä¸:c++
C++è¿ä¸ªè¯å¨ä¸å½å¤§éçç¨åºåååä¸é常被读åâCå å âï¼è西æ¹çç¨åºåé常读åâCplusplus","CPPâãå®æ¯ä¸ç§ä½¿ç¨é常广æ³ç计ç®æºç¼ç¨è¯è¨ãC++æ¯ä¸ç§éææ°æ®ç±»åæ£æ¥çãæ¯æå¤éç¼ç¨èå¼çéç¨ç¨åºè®¾è®¡è¯è¨ã