资 源 简 介
package com.fred.test;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Color;
import java.util.Random;
import java.util.List;
import java.util.LinkedList;
import javax.swing.JPanel;
import javax.swing.JFrame;
class Food{
Snake snake;
int x,y;
boolean flag;
Food(Snake snake){
this.snake = snake;
flag = true;
int x = 0;
int y = 0;
while(flag){
flag = false;
x = Math.abs(new Random().nextInt()%40);
y = Math.abs(new Ran