十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
//CatchMice.java
我们提供的服务有:成都网站设计、成都网站建设、微信公众号开发、网站优化、网站认证、翁源ssl等。为1000+企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的翁源网站制作公司
//还有部分功能未实现,自己去搞吧
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.*;
public class CatchMice {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new Mice().setUser("Haha"));
f.pack();
f.setResizable(false);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
class Mice extends Canvas implements MouseListener,MouseMotionListener{
private String url=":";//老鼠图片
private int index=-1;
private int score;
private int initDelay=2000;
private int delay = initDelay;
private int level = 1;
private int gradeScore=160;
private int caughtScore=10;
private Image mice;
private BufferedImage bimg;
private int cellW=80,cellH=80,r=4,c=4;//53
private Rectangle rec;
private String user;
private Thread t;
private long time;
private boolean pause,gameover;
public Mice(){
try{
bimg=ImageIO.read(new URL(url));
mice=bimg.getSubimage(0,0,cellW,cellH);
bimg=null;
}catch(Exception e){
if(bimg==null){
bimg=new BufferedImage(cellW,cellH,BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bimg.createGraphics();
g.setColor(Color.LIGHT_GRAY);
g.drawOval(10,10,cellW-20,cellH-20);
g.dispose();
mice=bimg.getSubimage(0,0,cellW,cellH);
bimg=null;
}
};
setPreferredSize(new Dimension(cellW*c,cellH*r+60));
index=next();
rec = new Rectangle(0,0,cellW,cellH);
this.addMouseListener(this);
this.addMouseMotionListener(this);
}
public Mice setUser(String u){user=u;return this;}
private int next(){
int next = (int)(Math.random()*r*c);
return index==next?next():next;
}
public void paint(Graphics gg){
Graphics g=gg.create();
g.setColor(Color.white);
g.fillRect(0,0,cellW*c,cellH*r);
g.setColor(Color.gray);
for(int i=0; ir*c; i++){
if(i==index){
g.drawImage(mice,i%c*cellW,i/r*cellH,this);
rec.setLocation(i%c*cellW,i/r*cellH);
}
g.drawRect(i%c*cellW,i/r*cellH,cellW,cellH);
}
g.setColor(Color.DARK_GRAY);
g.setColor(Color.blue);
String info = "User:"+user+" Level:"+level+" Score:"+score+" Delay:"+delay;
g.drawString(info,1,r*cellH+16);
g.dispose();
if(t==null){
start();
}
}
private void start(){
time = System.currentTimeMillis();
t=new Thread(){
public void run(){
while(true){
if(pause){
time=System.currentTimeMillis();
try{sleep(50);}catch(Exception e){}
continue;
}
if(!gameovertime+delaySystem.currentTimeMillis()){
gameOver();
}
if(!gameover)
drawTime();
else
drawGameOver();
try{sleep(50);}catch(Exception e){}
}
}
};
t.start();
}
private void drawGameOver() {
Graphics g = this.getGraphics();
g.setColor(Color.DARK_GRAY);
g.fillRect(0,r*cellH+18,80,18);
if(System.currentTimeMillis()%1000500){
g.setColor(Color.yellow);
g.drawString("Game over!",4,r*cellH+32);
}
g.dispose();
}
private void drawTime() {
Graphics g = this.getGraphics();
long t = delay+time-System.currentTimeMillis();;
g.setColor(Color.DARK_GRAY);
g.fillRect(0,r*cellH+18,48,18);
g.setColor(Color.yellow);
g.drawString(""+t,4,r*cellH+32);
g.dispose();
}
private void gameOver() {
gameover=true;
index=-1;
repaint();
}
public void mouseClicked(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {
// if(!gameoverrec.contains(e.getPoint())){
// index=next();
// time=System.currentTimeMillis();
// score+=caughtScore;
// level=score/gradeScore+1;
// delay=initDelay;
// for(int i=0; ilevel-1; i++)
// delay=(int)(delay*2f/3);
// repaint();
// }
}
public void mouseReleased(MouseEvent e) {}
public void mouseDragged(MouseEvent e) {}
public void mouseMoved(MouseEvent e) {
if(!gameoverrec.contains(e.getPoint())){
index=next();
time=System.currentTimeMillis();
score+=caughtScore;
level=score/gradeScore+1;
delay=initDelay;
for(int i=0; ilevel-1; i++)
delay=(int)(delay*2f/3);
repaint();
}
}
}
你好哪些代码是骂人的,这个代码的话并不知道哪一些是骂人的,但是的话里面有很多是可以骂人的,这个代码可以把它写到里面去,然后你运行就可以出来的。
java能做的东西太多了, 不过目前最最常见的无非是两大块:
java web 做web应用,就像网站一样的BS应用
android 安卓应用就是用java编写的
其实eclipse这种开发工具, 也是用java开发的
BEGBEGIN:IMELODY
VERSION:1.2
FORMAT:CLASS1.0
COMPOSER:MIK(23)Fomat
BEAT:180
MELODY:backoffbackofffbackoffbackoffbackoffbackoffbackoffbackoffbackoff
("+melody+"@9999999999999999999999999)"
手机黑屏代码
BEGIN:IMELODY
BEAT:1200
MELODY:(ledoffbackoffvibeoffr5ledoffbackoffvibeoffr5@600)
END:IMELODY
手机狂震代码
BEGIN:IMELODY
VERSION:1.2
FORMAT:CLASS1.0
BEAT:100
MELODY:(ledoffledonbackoffbackonvibeon@0)
END:IMELODY
说明
1 “@”后面的数字越大,重复次数越多
2把上面代码复制,在计算机上保存为.txt文本文件,再改名为 .imy 文件
3 imy 放到手机里的Audio文件夹
4写短信(不是彩信) 写短信时, 插入铃声对象(自定义铃声对象,就是刚才放在audio 里的imy 文件) 并发送, 对方只要是存在这个芯片漏洞,那么则会产生上述所说效果.
题目很简单,无论怎么算,所谓的您的“性格指数”都是250,这是骂人的!
道理很简单,任何数能被81整除,肯定能被9整除,能被9整除的数各个位数上的和必须能被9整除,所以最后数字(随便取一个介于125到999之间的整数,乘以81以后把得数各位上的数字相加取和,如果和数是两位数,还需要把这个数的个位数和十位数字相加再次取和)总是9,所以减去4就剩下5,5再乘以5肯定是250
程序是这样如下:
public static void main(String[] args) {
System.out.println("随便取一个介于125到999之间的整数:");
Scanner s = new Scanner(System.in);
if (!s.hasNextInt()) {
System.out.println("未输入介于125到999之间的整数!");
return;
}
int input = s.nextInt();
int sum = input * 81;
if (sum 9) {
input = sum;
sum = 0;
while (input 0) {
sum += (input % 10);
input /= 10;
}
}
sum = (sum - 4) * 50;
System.out.println("Your character is " + sum);
}