常用圆圈数字序号(1~50)

博客笔记①常用圆圈数字序号(1~50)

  •                          QQ:3020889729                                                                                 小蔡

                         QQ:3020889729                                                                                 小蔡

① ② ③ ④ ⑤
⑥ ⑦ ⑧ ⑨ ⑩
⑪ ⑫ ⑬ ⑭ ⑮
⑯ ⑰ ⑱ ⑲ ⑳
㉑ ㉒ ㉓ ㉔ ㉕
㉖ ㉗ ㉘ ㉙ ㉚
㉛ ㉜ ㉝ ㉞ ㉟
㊱ ㊲ ㊳ ㊴ ㊵
㊶ ㊷ ㊸ ㊹ ㊺
㊻ ㊼ ㊽ ㊾ ㊿

以下是一个实现示例: ```java import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.stage.Stage; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.Scanner; public class Main extends Application { private static final int MIN_RADIUS = 10; private static final int MAX_RADIUS = 20; private int circleCount; private List<Circle> circles; @Override public void start(Stage primaryStage) throws Exception { // 从键盘上输入圆圈的个数 Scanner scanner = new Scanner(System.in); System.out.print("请输入圆圈个数:"); circleCount = scanner.nextInt(); // 创建圆圈 circles = new ArrayList<>(); Random random = new Random(); for (int i = 0; i < circleCount; i++) { double radius = MIN_RADIUS + random.nextDouble() * (MAX_RADIUS - MIN_RADIUS); Color color = Color.rgb(random.nextInt(256), random.nextInt(256), random.nextInt(256)); Circle circle = new Circle(radius, color); circles.add(circle); } // 布局圆圈 boolean intersect; do { intersect = false; for (int i = 0; i < circleCount; i++) { Circle circle1 = circles.get(i); circle1.setCenterX(MIN_RADIUS + random.nextDouble() * (600 - 2 * MAX_RADIUS)); circle1.setCenterY(MIN_RADIUS + random.nextDouble() * (400 - 2 * MAX_RADIUS)); for (int j = i + 1; j < circleCount; j++) { Circle circle2 = circles.get(j); if (circle1.intersects(circle2.getBoundsInLocal())) { intersect = true; break; } } if (intersect) { break; } } } while (intersect); // 添加圆圈到面板 Pane root = new Pane(); root.getChildren().addAll(circles); // 显示窗口 primaryStage.setScene(new Scene(root, 600, 400)); primaryStage.show(); } public static void main(String[] args) { launch(args); } } ``` 该示例中,首先从键盘上输入圆圈的个数,然后创建圆圈,并随机生成半径和色彩。接着,使用一个循环来布局圆圈,每次随机生成圆心坐标,并检查当前圆圈是否与其他圆圈相交。如果有相交,则需要重新生成圆心坐标,直到所有圆圈都不相交为止。最后,将所有圆圈添加到面板中,并显示窗口。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

NULL not error

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值