会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133503个问题
Python 全系列/第一阶段:Python入门/Python入门(动画版) 34336楼

老师,我的代码没有错,但是刚开始的数字比例太大了,导致后面的图案显示不出来,画了也看不见怎么办?

# 画小孩
# 导入函数
import turtle

# 显示箭头,设置宽度,定义颜色
turtle.showturtle()
turtle.width(5)
turtle.color("red")

# 画左侧眼睛,抬笔
turtle.circle(20)
turtle.circle(40)
turtle.penup()

# 移动到点(100,0),落笔,画右侧眼睛,抬笔
turtle.goto(100,0)
turtle.pendown()
turtle.circle(20)
turtle.circle(40)
turtle.penup()

# 移动到点(50,60),落笔画嘴巴,抬笔
turtle.goto(50,-60)
turtle.pendown()
turtle.circle(20)
turtle.penup()

# 移动到点(80,-80),落笔,画脸
turtle.goto(80,-80)
turtle.pendown()
turtle.circle(100)

# 画身体,抬笔
turtle.forward(100)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(100)
turtle.penup()

# 移动到点(-50,-90),落笔,画左手臂,抬笔
turtle.goto(-50,-90)
turtle.pendown()
turtle.goto(-100,-280)
turtle.left(45)
turtle.forward(180)
turtle.right(90)
turtle.forward(25)
turtle.circle(30)
turtle.forward(25)
turtle.right(90)
turtle.forward(180)
turtle.right(153)
turtle.forward(125)
turtle.penup()

# 移动到点(210,-90),落笔,画右手臂,抬笔
turtle.goto(210,-90)
turtle.pendown()
turtle.goto(260,-280)
turtle.left(65)
turtle.forward(180)
turtle.left(90)
turtle.forward(25)
turtle.left(180)
turtle.circle(30)
turtle.left(180)
turtle.forward(25)
turtle.left(90)
turtle.forward(180)
turtle.left(155)
turtle.forward(80)
turtle.penup()

# 画两条腿
turtle.goto(55,-400)
turtle.pendown()

腿暂时没画,这是显示图,已经全屏了还是看不到下面部分,没办法下拉

image.png

Python 全系列/第一阶段:Python入门/编程基本概念 34337楼
JAVA 全系列/第四阶段:数据库与AI协同技术实战/SQL 语言 34340楼
JAVA 全系列/预科阶段:职业规划/学习方法/程序员的基本素养和职业规划 34341楼

飞机小游戏源码.zip

老师,我想问一下我敲的这个游戏好像开了挂一样,子弹会慢慢的变少,一开始80多颗跑个一两分钟就只有10几颗了,一开始10颗到后面就只有几颗了,还有就是飞机玩到一分多钟或者两分多钟的时候就会自爆,你能帮我跑跑看是哪里的问题吗?

JAVA 全系列/第一阶段:AI驱动的JAVA编程/飞机大战小项目训练 34342楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/数组和数据存储 34345楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/IO 流技术(旧) 34346楼

老师批量删除要怎么做呢?我用了同样的方法貌似行不通 哪里出了问题?

//批量删除
	public void deleteBatch(List<Departments> list) {
		Connection conn = null;
		PreparedStatement ps = null;
		try {
			conn = JdbcUtil.getConnection();
			ps = conn.prepareStatement("delete from departments where department_name=?");
			for(int i=0;i<list.size();i++) {
				ps.setString(1, list.get(i).getDepartmentName());
				//批处理
				ps.addBatch();
			}
			int[] arr =ps.executeBatch();
			for (int i = 0; i < arr.length; i++) {
				System.out.println(i);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}finally {
			JdbcUtil.closeResoure(ps, conn, null);
			
		}
	}
	
	public static void main(String[] args) {
		PreparedStatementDemon psd = new PreparedStatementDemon();
		//psd.insertDepartments("人力资源2", 12);
		//psd.updateDepartments("科研部", 7, 10);
		/*Departments dept = psd.selectDepartmentsId(9);
		if (dept !=null) {
			System.out.println(dept.getDepartmentId()+" "+dept.getDepartmentName()+" "+ dept.getLocationId());
		}
		*/
		/*List<Departments> list = psd.selectDepartmentsByLike("部");
		for (Departments dept : list) {
			System.out.println(dept.getDepartmentId()+" "+dept.getDepartmentName()+" "+dept.getLocationId());
		}*/
		/*List<Departments> list = new ArrayList<>();
		for(int i=1;i<=10;i++) {
			Departments dept = new Departments();
			dept.setDepartmentName("Dota部"+i);
			dept.setLocationId(10+i);
			list.add(dept);
		}
		psd.addBatch(list);*/
		List<Departments> list = new ArrayList<>();
		for(int i=1;i<=10;i++) {
			Departments dept = new Departments();
			dept.setDepartmentName("Dota部"+i);
			list.add(dept);
		}
		psd.addBatch(list);
		
	}

结果:

Thu Feb 20 18:18:13 CST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.


JAVA 全系列/第四阶段:数据库与AI协同技术实战/JDBC技术(旧) 34348楼
Python 全系列/第一阶段:Python入门/序列 34349楼
Python 全系列/第一阶段:Python入门/序列 34350楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637