java樱花源代码,樱花html代码

樱花的代码怎么打

通过代码敲出樱花开放可以用Matlab或者C语言进行,主要是编写相关程序。目前由武汉大学学生开发的樱花开放Python源代码已经正式公布,用户将图中cv_2.cv_3.cv_4依次执行即可。值得注意的是这段由Python代码组成的樱花延时开放美景由无数个“武汉加油”组成,每个字都是一个像素点。

创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站制作、网站建设、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的穆棱网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

作为具有地标意义的武大樱花,虽然在今年疫情防控期间暂停对外开放,但坐在家中的你,照样可以欣赏到樱花争相盛开的美景——近日,武汉大学信息管理与信息系统大二学生朱永春,用Python代码敲出了樱花开放。

无数个“武汉加油”汇聚在一起,每个字都是一个像素点,@武汉大学 信管院学生用代码敲出延时开放的一朵樱花。看一朵花开,等花开成海,没有一个春天不会到来。

值得注意的是这段由Matlab代码组成的樱花延时开放美景由无数个“武汉加油”组成,每个字都是一个像素点。

武大学生代码敲出樱花开放是怎么回事?

2020年3月19日消息受目前新冠病毒疫情影响,武汉大学先前开通了在线直播的方式让全国游客可以“云赏樱”,同时武汉大学的学生们还将武大樱花美景“融合”到代码中。

是武汉大学信管学院朱永春同学用Python所创作,据朱同学介绍,写代码的时间总共大概花了三四个小时,因为平时有这样的想法,刚好灵感闪现,就想到用这种方式来给武汉加油。

由武汉大学学生开发的樱花开放Python源代码已经正式公布,用户将图中cv_2.cv_3.cv_4依次执行即可。

值得注意的是这段由Python代码组成的樱花延时开放美景由无数个“武汉加油”组成,每个字都是一个像素点。

程序大神速来 java画图问题

直接将代码复制就能运行。画的是一只乌龟

package Draw;

import java.awt.*;

import java.awt.event.MouseEvent;

import java.awt.event.MouseListener;

import java.awt.event.MouseMotionListener;

public class Tortoise1 {

public static void main(String args[]){

Frame w=new Frame();

w.setSize(1280,800);

TortoisePanel1 tp=new TortoisePanel1();

w.add(tp);

w.addMouseListener(tp);

tp.addMouseListener(tp);

w.addMouseMotionListener(tp);

tp.addMouseMotionListener(tp);

Thread  t=new Thread(tp);

t.start();

w.show();

}

}

class TortoisePanel1 extends Panel implements MouseListener,MouseMotionListener,Runnable{

int x = 30;

int y = 30 ;

int mx = 0;

int my = 0;

int flag=-1;

boolean b = true ;

public void paint(Graphics g){

super.paint(g) ;

this.setBackground(Color.LIGHT_GRAY) ;

if (b){

g.setColor(new Color( 80 , 180 , 80 )) ; //尾巴

g.fillOval( 140+x , 285+y , 150 , 150 ) ;

g.setColor(Color.LIGHT_GRAY) ;

g.fillOval( 155+x , 300+y , 140 , 140) ;

g.fillOval( 195+x , 260+y , 200 ,240 ) ;

g.setColor(new Color( 80 , 180 , 80 )) ;

g.fillOval( 145+x , 355+y , 40 , 40) ;

g.setColor(Color.LIGHT_GRAY) ;

g.fillOval( 157+x , 367+y , 15 , 15) ;

}else{

g.setColor(new Color( 80 , 180 , 80)) ; //尾巴

g.fillOval(13+x , 260+y , 150 , 150) ;

g.setColor(Color.LIGHT_GRAY) ;

g.fillOval(3+x , 265+y , 143 , 143) ;

g.setColor(new Color( 80 , 180 , 80)) ;

g.fillOval(100+x,353+y,40,40) ;

g.setColor(Color.LIGHT_GRAY) ;

g.fillOval(113+x , 365+y , 15 , 15) ;

}

if (b){

g.setColor(new Color(80,180,80)) ; //头

g.fillOval( 120+x , 80+y , 60 , 100 ) ;

g.setColor(Color.WHITE) ;

g.fillOval( 130+x ,90+y , 10 ,10 ) ; //左眼

g.fillOval( 160+x ,90+y , 10 ,10 ) ; //右眼

g.setColor(Color.BLACK) ;

g.fillOval( 130+x ,90+y , 8 ,8 ) ; //左眼珠

g.fillOval( 160+x ,90+y , 8 ,8 ) ; //右眼珠

}else{

g.setColor(new Color(80,180,80)) ; //头

g.fillOval( 120+x , 80+y , 60 , 100 ) ;

g.setColor(new Color(200,0,0)) ; //嘴

g.fillOval( 130+x , 100+y , 40 ,50 ) ;

g.setColor(new Color(80,180,80)) ;

g.fillOval( 130+x , 80+y , 40 ,50 ) ;

g.setColor(Color.BLACK) ;

g.drawLine( 143+x ,83+y , 140+x , 90+y ) ; //鼻子

g.drawLine( 158+x ,83+y , 160+x , 90+y ) ;

}

if (b){

g.setColor(new Color(80,180,80)) ;

g.fillOval( 50+x ,140+y ,50 , 70 ) ; //左爪

g.fillOval( 200+x ,140+y ,50 , 70 ) ; //右爪

g.fillOval( 50+x ,280+y ,50 , 70 ) ; //左后爪

g.fillOval( 200+x ,280+y ,50 , 70 ) ; //右后爪

}else{

g.setColor(new Color(80,180,80)) ; //左爪

g.fillOval( 50+x ,140+y ,50 , 70 ) ;

g.setColor(new Color(250,100,150)) ; //左指头

g.fillOval( 55+x ,155+y ,5 , 7 ) ;

g.fillOval( 65+x ,148+y ,5 , 7 ) ;

g.fillOval( 75+x ,145+y ,5 , 7 ) ;

g.fillOval( 85+x ,150+y ,5 , 7 ) ;

g.fillOval( 65+x ,160+y ,20 , 20 ) ;

g.setColor(new Color(80,180,80)) ; //右爪

g.fillOval( 200+x ,140+y ,50 , 70 ) ;

g.setColor(new Color(250,100,150)) ; //右指头

g.fillOval( 210+x ,150+y ,5 , 7 ) ;

g.fillOval( 220+x ,145+y ,5 , 7 ) ;

g.fillOval( 230+x ,148+y ,5 , 7 ) ;

g.fillOval( 240+x ,155+y ,5 , 7 ) ;

g.fillOval( 215+x ,160+y ,20 , 20 ) ;

g.setColor(new Color(80,180,80)) ; //左后爪

g.fillOval( 50+x ,280+y ,50 , 70 ) ;

g.setColor(new Color(250,100,150)) ; //左后指头

g.fillOval( 50+x ,315+y ,5 , 7 ) ;

g.fillOval( 55+x ,328+y,5 , 7 ) ;

g.fillOval( 65+x ,340+y ,5 , 7 ) ;

g.fillOval( 80+x ,340+y ,5 , 7 ) ;

g.fillOval( 63+x ,310+y ,20 , 20 ) ;

g.setColor(new Color(80,180,80)) ; //右后爪

g.fillOval( 200+x ,280+y ,50 , 70 ) ;

g.setColor(new Color(250,100,150)) ; //右后指头

g.fillOval( 245+x ,320+y ,5 , 7 ) ;

g.fillOval( 240+x ,330+y ,5 , 7 ) ;

g.fillOval( 230+x ,340+y ,5 , 7 ) ;

g.fillOval( 215+x ,338+y ,5 , 7 ) ;

g.fillOval( 215+x ,310+y ,20 , 20 ) ;

}

if (b){

g.setColor(new Color(50 ,160 , 50)) ; //大圈

g.fillOval( 60+x , 150+y , 180 ,200 ) ;

g.setColor(new Color(50,200,50)) ;

g.fillOval( 70+x , 160+y , 160 ,180 ) ; //小圈

g.setColor(new Color(0,0,0)) ;

g.drawLine( 130+x , 210+y , 170+x , 210+y ) ; //中间的花纹

g.drawLine( 170+x , 210+y , 200+x , 240+y ) ;

g.drawLine( 200+x , 240+y , 170+x , 270+y ) ;

g.drawLine( 170+x , 270+y , 130+x , 270+y ) ;

g.drawLine( 130+x , 270+y , 100+x , 240+y ) ;

g.drawLine( 100+x , 240+y , 130+x , 210+y ) ;  

g.drawLine( 100+x , 180+y , 130+x , 210+y ) ; //扩散出来的花纹

g.drawLine( 170+x , 210+y , 200+x ,180+y ) ;

g.drawLine( 200+x , 240+y , 230+x ,250+y ) ;

g.drawLine( 170+x , 270+y , 200+x ,320+y ) ;

g.drawLine( 130+x , 270+y , 100+x ,320+y ) ;

g.drawLine( 100+x , 240+y , 70+x ,250+y ) ;

} else {

g.setColor(new Color(80,180,80)) ;

g.fillOval( 60+x , 150+y , 180 ,200 ) ; //大圈

g.setColor(new Color(255,230,240)) ;

g.fillOval( 70+x , 160+y , 160 ,180 ) ; //小圈

g.setColor(new Color(0,0,0)) ; //肚肚上的花纹

g.drawLine( 100+x ,180+y , 115+x , 195+y ) ;

g.drawLine( 200+x ,180+y , 185+x , 195+y ) ;

g.drawLine( 115+x ,195+y , 185+x , 195+y ) ;

g.drawLine( 100+x ,240+y , 75+x , 220+y ) ;

g.drawLine( 200+x ,240+y , 225+x , 220+y ) ;

g.drawLine( 100+x ,240+y , 200+x , 240+y ) ;

g.drawLine( 120+x ,290+y , 90+x , 310+y ) ;

g.drawLine( 180+x ,290+y , 210+x , 310+y ) ;

g.drawLine( 120+x ,290+y , 180+x , 290+y ) ;

g.drawLine( 150+x ,160+y , 150+x , 340+y ) ;

}

}

public void mouseClicked(MouseEvent e) {

// TODO Auto-generated method stub

}

public void mouseEntered(MouseEvent e) {

// TODO Auto-generated method stub

int x1,y1;

x1=e.getX();

y1=e.getY();

if(x1x){flag=1;}

if(x1x){flag=3;}

}

public void mouseExited(MouseEvent e) {

// TODO Auto-generated method stub

}

public void mousePressed(MouseEvent e) {

// TODO Auto-generated method stub

b=false;

repaint();

}

public void mouseReleased(MouseEvent e) {

// TODO Auto-generated method stub

b=true;

repaint();

}

public void mouseDragged(MouseEvent arg0) {

// TODO Auto-generated method stub

b=true;

//   System.out.println("鼠标拖动");

//   System.out.println("X坐标:"+arg0.getX()+" Y坐标:"+arg0.getY());

x=arg0.getX();//获得矩形右下角的X坐标

y=arg0.getY();//获得矩形右下角的Y坐标

repaint();

}

public void mouseMoved(MouseEvent arg0) {

// TODO Auto-generated method stub

}

public void run() {

// TODO Auto-generated method stub

if(flag==1){

x++;

}

if(flag==2){

y++;

}

if(flag==3){

x--;

}

if(flag==4){

y--;

}

}

}

点击乌龟,可以翻身。

求flash樱花飘落的源代码

JS实现的前端源码 带展示页 完整代码  樱花飘落 希望你会喜欢!


网页标题:java樱花源代码,樱花html代码
转载注明:http://csdahua.cn/article/dsiijpg.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流