真正的小白,学习第一天,从课程中了解了Java和Python的区别,开发的些许历史以及笔记的重要性。
因此搜索了Typora
软件很优秀希望喜欢的朋友支持正版,本人电脑即将替换,会在换设备之后”补票“
Typora下载
https://www.aliyundrive.com/s/qyexdZ4DSir 提取码: 34ku
Typora的基础使用笔记
标题
#(空格)一级标题 快捷键为:Ctrl + 1
##(空格)二级标题 快捷键为:Ctrl + 2
......
以此类推,# 的个数代表等级(记得#后有空格),共六个等级
字体
老嫂子(斜体)
老嫂子(粗体)
老嫂子
老嫂子(删除线)
*斜体字体* 开头一个*,结尾一个*
**加粗字体** 开头两个**,结尾两个**
***加粗斜字体*** 开头三个***,结尾三个***
~~删除线~~ 开头两个~~,结尾两个~~
表格
名字 | 性别 | 身高 | 体重 |
|名字|性别|身高|体重| 回车即可
插入图片
![图片名称]() 括号中自动显示:输入图片路径/选择本地文件,括号英文输入法下输入
超链接
[文字](输入网址) 括号英文输入法下输入
列表
老嫂子一号
老嫂子二号
老嫂子A
老嫂子B
1.(空格)文字 回车自动添加序号
-(空格) 自动出现无序号
代码
开头```+语言名,开启代码块 (~键英文输入下打出三个点)
以下用Chatgpt 要了一段贪吃蛇的代码,哈哈哈哈~
importjava.awt.Color;
importjava.awt.Graphics;
importjava.awt.Point;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.awt.event.KeyEvent;
importjava.awt.event.KeyListener;
importjava.util.ArrayList;
importjava.util.Random;
importjavax.swing.JFrame;
importjavax.swing.JPanel;
importjavax.swing.Timer;
publicclassSnakeGameextendsJPanelimplementsActionListener, KeyListener {
privatestaticfinallongserialVersionUID=1L;
privatestaticfinalintWIDTH=500, HEIGHT=500;
privatestaticfinalintDELAY=100;
privatestaticfinalintUNIT_SIZE=20;
privateArrayList<Point>snake;
privatePointfood;
privateintdirection;
privateTimertimer;
privateRandomrandom;
publicSnakeGame() {
snake=newArrayList<Point>();
snake.add(newPoint(WIDTH/2, HEIGHT/2));
food=newPoint();
random=newRandom();
generateFood();
timer=newTimer(DELAY, this);
timer.start();
addKeyListener(this);
setFocusable(true);
}
publicvoidpaintComponent(Graphicsg) {
super.paintComponent(g);
g.setColor(Color.RED);
g.fillRect(food.x, food.y, UNIT_SIZE, UNIT_SIZE);
g.setColor(Color.BLACK);
for (inti=0; i<snake.size(); i++) {
g.fillRect(snake.get(i).x, snake.get(i).y, UNIT_SIZE, UNIT_SIZE);
}
}
publicvoidactionPerformed(ActionEvente) {
move();
checkCollision();
repaint();
}
publicvoidkeyPressed(KeyEvente) {
if (e.getKeyCode() ==KeyEvent.VK_UP&&direction!=2) {
direction=0;
} elseif (e.getKeyCode() ==KeyEvent.VK_DOWN&&direction!=0) {
direction=2;
} elseif (e.getKeyCode() ==KeyEvent.VK_LEFT&&direction!=1) {
direction=3;
} elseif (e.getKeyCode() ==KeyEvent.VK_RIGHT&&direction!=3) {
direction=1;
}
}
publicvoidkeyReleased(KeyEvente) {}
publicvoidkeyTyped(KeyEvente) {}
privatevoidmove() {
for (inti=snake.size() -1; i>0; i--) {
snake.get(i).x=snake.get(i-1).x;
snake.get(i).y=snake.get(i-1).y;
}
if (direction==0) {
snake.get(0).y-=UNIT_SIZE;
} elseif (direction==1) {
snake.get(0).x+=UNIT_SIZE;
} elseif (direction==2) {
snake.get(0).y+=UNIT_SIZE;
} elseif (direction==3) {
snake.get(0).x-=UNIT_SIZE;
}
}
privatevoidcheckCollision() {
if (snake.get(0).x==food.x&&snake.get(0).y==food.y) {
snake.add(newPoint(snake.get(snake.size() -1)));
generateFood();
}
for (inti=1; i<snake.size(); i++)