目录

飞算 JavaAl 产品介绍 

安装飞算 JavaAl 

第一步:点击 File->Setting

第二步:点击 Plugins

第三步:搜索 CalEx-JavaAI

第四步:点击 Install 进行安装

第五步:点击 Install ,查看安装好的飞算JavaAI

 注册飞算 JavaAI

第一步:点击Java chat,再点击立即登录

第二步:注册账号

体验飞算JavaAI

1、体验它的代码编写能力

2、体验飞算JavaAI对代码的优化和改进

3、分享部分贪吃蛇代码(看看飞算JavaAI写的怎么样)

总结一下


飞算 JavaAl 产品介绍 

飞算JavaAI 是飞算科技于2025年1月发布的全球首款聚焦Java语言的智能开发助手。该工具通过自然语言或语音输入开发需求,可自动完成需求分析、软件设计及完整工程代码生成全流程,输出包含配置类文件、Java源代码目录、资源文件及测试资源在内的整套工程源码。相较于片段式代码生成工具,其完整工程代码生成能力使开发效率提升10倍,有效降低重复编码工作量,助力开发者聚焦业务逻辑创新与系统架构优化。

安装飞算 JavaAl 

第一步:点击 File->Setting

第二步:点击 Plugins

第三步:搜索 CalEx-JavaAI

第四步:点击 Install 进行安装

静静等待安装 ing~

第五步:点击 Install ,查看安装好的飞算JavaAI

点击Apply然后在点击OK

安装成功!!!

 注册飞算 JavaAI

第一步:点击Java chat,再点击立即登录

第二步:注册账号

微信扫码就可以直接注册登录了,然后绑定一下手机号即可

注册登录成功,可以开始使用飞算JavaAI了

体验飞算JavaAI

1、体验它的代码编写能力

生成一个贪吃蛇小游戏,用JavaFX编写,注意页面的美观。

直接就将代码写好了,我们直接点击接受就行

这里可以看到飞算JavaAI帮我们生成的项目目录,十分规范。代码也帮我们直接写好了,我们不需要写任何代码,现在直接让我们来测试一下它写的代码有没有什么问题。

点击运行代码

可以看到非常顺利的运行了出来,十分简单

我们刚刚体验了飞算JavaAI在Java项目结构上的创建以及代码的编写能力,体验感非常的不错,可以很快的帮我们处理我们遇到的问题。那么接下来我们在那飞算JavaAI来测试一下它在代码的优化以及交换上面的体验。

2、体验飞算JavaAI对代码的优化和改进

AI提示词:我觉的这个界面不说很好看,请你帮我设计的更加好看一点,并且我觉得将每场得分的结果记录在我的数据库表中,我的数据库地址是localhost:3306,用户名root,密码1234。游戏失败了可以重新开始。

可以建到它将游戏界面优化的更加炫酷了。 

并且创建了属于该项目的数据库。

create database mygame;
USE mygame;CREATE TABLE snake_scores (id INT AUTO_INCREMENT PRIMARY KEY,score INT NOT NULL,timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

基本上要求全部都达到了,后期只需要按照自己的需求慢慢改进即可。使用起来还是十分顺手的。

3、分享部分贪吃蛇代码(看看飞算JavaAI写的怎么样)

SnakeGame.Java文件 

package com.hmall.fxcsdn;import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;public class SnakeGame extends Application {private static final int TILE_SIZE = 20;private static final int WIDTH = 30;private static final int HEIGHT = 30;private Canvas canvas;private GraphicsContext gc;private int[] snakeX = new int[WIDTH * HEIGHT];private int[] snakeY = new int[WIDTH * HEIGHT];private int snakeLength = 3;private int foodX;private int foodY;private int directionX = 1;private int directionY = 0;private int score = 0;private Label scoreLabel;private Label statusLabel;private AnimationTimer timer;private Button restartButton;@Overridepublic void start(Stage primaryStage) {primaryStage.setTitle("贪吃蛇游戏");canvas = new Canvas(WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE);gc = canvas.getGraphicsContext2D();scoreLabel = new Label("Score: " + score);scoreLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: white;");statusLabel = new Label("Status: Playing");statusLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: white;");restartButton = new Button("重新开始");restartButton.setOnAction(event -> restartGame());restartButton.setStyle("-fx-font-size: 24px; -fx-background-color: darkgreen; -fx-text-fill: white;");HBox controls = new HBox(10, scoreLabel, statusLabel, restartButton);controls.setAlignment(Pos.CENTER);controls.setStyle("-fx-background-color: #333333; -fx-padding: 10px;");BorderPane root = new BorderPane();root.setTop(controls);root.setCenter(canvas);root.setStyle("-fx-background-color: black;");Scene scene = new Scene(root, WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE + 50);scene.addEventHandler(KeyEvent.KEY_PRESSED, event -> {switch (event.getCode()) {case UP:if (directionY == 0) {directionX = 0;directionY = -1;}break;case DOWN:if (directionY == 0) {directionX = 0;directionY = 1;}break;case LEFT:if (directionX == 0) {directionX = -1;directionY = 0;}break;case RIGHT:if (directionX == 0) {directionX = 1;directionY = 0;}break;}});primaryStage.setScene(scene);primaryStage.show();generateFood();timer = new AnimationTimer() {@Overridepublic void handle(long now) {update();draw();}};timer.start();}private void generateFood() {foodX = (int) (Math.random() * WIDTH);foodY = (int) (Math.random() * HEIGHT);}private void update() {for (int i = snakeLength; i > 0; i--) {snakeX[i] = snakeX[i - 1];snakeY[i] = snakeY[i - 1];}snakeX[0] += directionX;snakeY[0] += directionY;if (snakeX[0] >= WIDTH || snakeX[0] < 0 || snakeY[0] >= HEIGHT || snakeY[0] < 0) {// 游戏结束条件System.out.println("游戏结束!");statusLabel.setText("Status: Game Over");timer.stop();saveScore(score);}if (snakeX[0] == foodX && snakeY[0] == foodY) {snakeLength++;score++;scoreLabel.setText("Score: " + score);generateFood();}for (int i = 1; i < snakeLength; i++) {if (snakeX[0] == snakeX[i] && snakeY[0] == snakeY[i]) {// 游戏结束条件System.out.println("游戏结束!");statusLabel.setText("Status: Game Over");timer.stop();saveScore(score);}}}private void draw() {gc.clearRect(0, 0, WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE);// 绘制食物gc.setFill(Color.RED);gc.fillRect(foodX * TILE_SIZE, foodY * TILE_SIZE, TILE_SIZE, TILE_SIZE);// 绘制蛇gc.setFill(Color.GREEN);for (int i = 0; i < snakeLength; i++) {gc.fillRect(snakeX[i] * TILE_SIZE, snakeY[i] * TILE_SIZE, TILE_SIZE - 2, TILE_SIZE - 2);}}private void restartGame() {snakeLength = 3;score = 0;scoreLabel.setText("Score: " + score);statusLabel.setText("Status: Playing");directionX = 1;directionY = 0;generateFood();timer.start();}private void saveScore(int score) {String url = "jdbc:mysql://localhost:3306/mygame"; // 替换为您的数据库名称String user = "root";String password = "1234";try (Connection conn = DriverManager.getConnection(url, user, password)) {String sql = "INSERT INTO snake_scores (score) VALUES (?)";PreparedStatement pstmt = conn.prepareStatement(sql);pstmt.setInt(1, score);pstmt.executeUpdate();} catch (SQLException e) {System.out.println("Error saving score: " + e.getMessage());}}public static void main(String[] args) {launch(args);}
}

SnakeGame.Java文件 

package com.snakegame;import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;public class SnakeGame extends Application {private static final int TILE_SIZE = 20;private static final int WIDTH = 30;private static final int HEIGHT = 30;private Canvas canvas;private GraphicsContext gc;private int[] snakeX = new int[WIDTH * HEIGHT];private int[] snakeY = new int[WIDTH * HEIGHT];private int snakeLength = 3;private int foodX;private int foodY;private int directionX = 1;private int directionY = 0;private int score = 0;private Label scoreLabel;private Label statusLabel;private AnimationTimer timer;private Button restartButton;private long lastUpdateTime = 0;private static final long UPDATE_INTERVAL = 200_000_000; // 0.2秒@Overridepublic void start(Stage primaryStage) {primaryStage.setTitle("贪吃蛇游戏");canvas = new Canvas(WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE);gc = canvas.getGraphicsContext2D();scoreLabel = new Label("Score: " + score);scoreLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: white;");statusLabel = new Label("Status: Playing");statusLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: white;");restartButton = new Button("重新开始");restartButton.setOnAction(event -> restartGame());restartButton.setStyle("-fx-font-size: 24px; -fx-background-color: darkgreen; -fx-text-fill: white;");HBox controls = new HBox(10, scoreLabel, statusLabel, restartButton);controls.setAlignment(Pos.CENTER);controls.setStyle("-fx-background-color: #333333; -fx-padding: 10px;");BorderPane root = new BorderPane();root.setTop(controls);root.setCenter(canvas);root.setStyle("-fx-background-color: black;");Scene scene = new Scene(root, WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE + 50);scene.setOnKeyPressed(event -> {switch (event.getCode()) {case UP:if (directionY == 0) {directionX = 0;directionY = -1;}break;case DOWN:if (directionY == 0) {directionX = 0;directionY = 1;}break;case LEFT:if (directionX == 0) {directionX = -1;directionY = 0;}break;case RIGHT:if (directionX == 0) {directionX = 1;directionY = 0;}break;}});primaryStage.setScene(scene);primaryStage.show();generateFood();timer = new AnimationTimer() {@Overridepublic void handle(long now) {if (now - lastUpdateTime >= UPDATE_INTERVAL) {update();draw();lastUpdateTime = now;}}};timer.start();}private void generateFood() {foodX = (int) (Math.random() * WIDTH);foodY = (int) (Math.random() * HEIGHT);}private void update() {for (int i = snakeLength; i > 0; i--) {snakeX[i] = snakeX[i - 1];snakeY[i] = snakeY[i - 1];}snakeX[0] += directionX;snakeY[0] += directionY;if (snakeX[0] >= WIDTH || snakeX[0] < 0 || snakeY[0] >= HEIGHT || snakeY[0] < 0) {// 游戏结束条件System.out.println("游戏结束!");statusLabel.setText("Status: Game Over");timer.stop();saveScore(score);}if (snakeX[0] == foodX && snakeY[0] == foodY) {snakeLength++;score++;scoreLabel.setText("Score: " + score);generateFood();}for (int i = 1; i < snakeLength; i++) {if (snakeX[0] == snakeX[i] && snakeY[0] == snakeY[i]) {// 游戏结束条件System.out.println("游戏结束!");statusLabel.setText("Status: Game Over");timer.stop();saveScore(score);}}}private void draw() {gc.clearRect(0, 0, WIDTH * TILE_SIZE, HEIGHT * TILE_SIZE);// 绘制食物gc.setFill(Color.RED);gc.fillRect(foodX * TILE_SIZE, foodY * TILE_SIZE, TILE_SIZE, TILE_SIZE);// 绘制蛇gc.setFill(Color.GREEN);for (int i = 0; i < snakeLength; i++) {gc.fillRect(snakeX[i] * TILE_SIZE, snakeY[i] * TILE_SIZE, TILE_SIZE - 2, TILE_SIZE - 2);}}private void restartGame() {snakeLength = 3;score = 0;scoreLabel.setText("Score: " + score);statusLabel.setText("Status: Playing");directionX = 1;directionY = 0;generateFood();timer.start();}private void saveScore(int score) {String url = "jdbc:mysql://localhost:3306/mygame"; // 替换为您的数据库名称String user = "root";String password = "1234";try (Connection conn = DriverManager.getConnection(url, user, password)) {String sql = "INSERT INTO snake_scores (score) VALUES (?)";PreparedStatement pstmt = conn.prepareStatement(sql);pstmt.setInt(1, score);pstmt.executeUpdate();} catch (SQLException e) {System.out.println("Error saving score: " + e.getMessage());}}public static void main(String[] args) {launch(args);}
}

全是由飞算ai自己写的哦~ 

总结一下

本次实践验证了飞算 JavaAI 在提升开发效率、降低技术门槛方面的实际价值,其工程化能力已具备生产环境应用基础。期待后续通过算法模型升级与场景拓展,进一步释放智能化开发工具在软件工程全周期中的潜力,为技术团队提供更深度的生产力赋能。

  1. 完成内容:介绍功能、完成安装注册及实操验证,工具在代码生成、调试等场景表现稳定。
  2. 后续计划:将在工作中深化应用,观察其在复杂业务场景的表现,期待版本迭代优化。

整体上感觉还不错,后续工作和日常生活中在看看,期待飞算JavaAI后续的表现。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/web/87991.shtml
繁体地址,请注明出处:http://hk.pswp.cn/web/87991.shtml
英文地址,请注明出处:http://en.pswp.cn/web/87991.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

无人设备遥控器之姿态控制算法篇

无人设备遥控器的姿态控制算法通过传感器数据融合、控制算法优化和执行机构调节实现动态平衡&#xff0c;核心算法包括PID控制、自适应控制、模型预测控制&#xff08;MPC&#xff09;&#xff0c;以及数据融合中的互补滤波和卡尔曼滤波&#xff0c;同时涉及四元数算法和深度强…

【加解密与C】Base系列(三)Base85

Base85 编码简介 Base85&#xff08;也称为 Ascii85&#xff09;是一种二进制到文本的编码方案&#xff0c;用于将二进制数据转换为可打印的ASCII字符。它的效率高于Base64&#xff0c;但生成的字符串可能包含特殊字符&#xff08;如引号或反斜杠&#xff09;&#xff0c;需在…

Docker企业级应用:从入门到生产环境最佳实践

一、Docker核心概念与架构 1.1 Docker技术栈 #mermaid-svg-CUEiyGo05ZYG524v {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-CUEiyGo05ZYG524v .error-icon{fill:#552222;}#mermaid-svg-CUEiyGo05ZYG524v .error-te…

8、保存应用数据

目录用户首选项的使用用户首选项主要API用户首选项开发流程用户首选项开发实践关系型数据库的使用关系型数据库工作流程关系型数据库开发实践用户首选项的使用 用户首选项主要API 用户首选项开发流程 成功的获取了一个名为myStore的Preferences实例 保存了一个键值对&#x…

(C++)list列表相关基础用法(C++教程)(STL库基础教程)

源代码&#xff1a;#include <iostream> #include <list>using namespace std;int main(){list<int> numbers{10,20,30};numbers.push_front(5);numbers.push_back(40);auto it numbers.begin();advance(it,2);numbers.insert(it,15);cout<<"该列…

Spring CGLIB私有方法访问成员变量为null问题

场景 代码 RestController public class TestJob {Autowiredprivate XxService xxService;XxlJob("testCGLIB")private void doTest(){System.out.println("方法调用");System.out.println("成员变量注入:"(xxService!null));this.doInnerTest()…

Paimon本地表查询引擎LocalTableQuery详解

LocalTableQueryLocalTableQuery 是 Paimon 中实现本地化、带缓存的表查询的核心引擎。它的主要应用场景是 Flink 中的 Lookup Join。当 Flink 作业需要根据一个流中的 Key 去关联一个 Paimon 维表时&#xff0c;LocalTableQuery 可以在 Flink 的 TaskManager 节点上&#xff0…

使用协程简化异步资源获取操作

异步编程的两种场景 在异步编程中&#xff0c;回调函数通常服务于两种不同场景&#xff1a; 一次性资源获取&#xff1a;等待异步操作完成并返回结果。持续事件通知。监听并响应多个状态变更。 Kotlin为这两种场景提供了解决方案&#xff1a;使用挂起函数简化一次性资源获取…

ABP VNext + Cosmos DB Change Feed:搭建实时数据变更流服务

ABP VNext Cosmos DB Change Feed&#xff1a;搭建实时数据变更流服务 &#x1f680; &#x1f4da; 目录ABP VNext Cosmos DB Change Feed&#xff1a;搭建实时数据变更流服务 &#x1f680;TL;DR ✨&#x1f680;1. 环境与依赖 &#x1f3d7;️2. 服务注册与依赖注入 &…

STM32-定时器

定时器&#xff1a;有4个独立通道&#xff1a;输入捕获&#xff1b;输出比较PWM生成&#xff1b;单脉冲模式输出&#xff1b;可通外部信号控制定时器&#xff08;TIMx-ETR&#xff09;&#xff1b;支持针对定时的增量&#xff08;正交&#xff09;编码器、霍尔传感器电路通用定…

Windows Server 2019--职业技能大赛B模块Windows服务器配置样题

一、赛题说明 &#xff08;一&#xff09;竞赛介绍 请详细阅读网络拓扑图&#xff0c;为所有计算机修改默认防火墙以便允许ICMP和相应的流量&#xff0c;不允许直接关闭主机的防火墙。除了CD-ROM/HDD驱动器&#xff0c;请不要修改虚拟机本身的硬件设置。 &#xff08;二&…

vue3+Echarts实现立体柱状图

Echarts柱状图中文网&#xff1a;https://echarts.apache.org/examples/zh/index.html#chart-type-bar 效果展示&#xff1a; 主要实现过程是三部分的组合&#xff0c;最上面是一个椭圆&#xff0c;中间是正常的柱子&#xff0c;下方再加上一个椭圆&#xff0c;就出来立体的效…

【UE5】虚幻引擎小百科

一、类名前面的大写字母的含义是什么UE5常见前缀分类表前缀含义实例用于AActorACharacter&#xff0c;AWeaponBase可放入世界中的对象&#xff08;有位置、可碰撞等&#xff09;UUObject派生类UUserWidget&#xff0c;UWeaponComponent引擎对象、逻辑模块&#xff0c;不具备Tra…

【Linux系统】vim编辑器 | 编译器gcc/g++ | make/Makefile

1. vim编辑器一、历史发展与Vim vs Vi的区别起源与演进Vi&#xff08;1976年&#xff09; &#xff1a;由Bill Joy开发&#xff0c;嵌入BSD Unix系统&#xff0c;是首个面向屏幕的文本编辑器&#xff0c;但功能有限&#xff08;如无多级撤销&#xff09;。Vim&#xff08;1991年…

国产飞腾主板,赋能网络安全防御硬手段

​ 当前&#xff0c;网络安全形势严峻&#xff0c;网络攻击手段不断翻新&#xff0c;从数据泄露到电脑中毒&#xff0c;企业、机构乃至国家的数字资产都面临着巨大风险。在此背景下&#xff0c;国产硬件技术的突破对筑牢网络安全防线意义重大。 高能计算机基于市场需求&#…

Spring AI 概述与架构设计

目录一、前言二、简介三、核心能力概览四、理解模块架构图五、模型适配能力六、最小应用示例七、与传统 LLM 调用相比八、总结九、参考一、前言 在 AI 正以前所未有的速度“下沉”到各类系统与业务的当下&#xff0c;Spring 官方推出的 Spring AI 项目&#xff0c;为 Java 开发…

UI前端与数字孪生融合新领域:智慧环保的污染源监测与治理

hello宝子们...我们是艾斯视觉擅长ui设计、前端开发、数字孪生、大数据、三维建模、三维动画10年经验!希望我的分享能帮助到您!如需帮助可以评论关注私信我们一起探讨!致敬感谢感恩!一、引言&#xff1a;数字孪生重构智慧环保的技术范式在环境污染治理压力持续增大的背景下&…

【go/wails】wails入门系列(一)环境安装与demo

文章目录说在前面go安装nodejs安装wails创建项目运行说在前面 操作系统&#xff1a;win11go版本&#xff1a;1.24.4nodejs版本&#xff1a;v22.16.0wails版本&#xff1a;v2.10.1 go安装 官网 这里 下载安装即可 nodejs 官网 这里 下载安装即可 安装wails 设置go国内代理g…

linux qt 使用log4cpp库

一、日志库下载 下载地址&#xff1a;https://log4cpp.sourceforge.net/二、日志库解压&#xff0c;编译 1.将文件夹解压出来2.进入文件夹内部&#xff0c;打开终端3.终端中依次输入以下命令 mkdir build ./configure --prefix$(pwd)/build make make install 一般来说不会报错…

探索阿里云Data Integration:数据同步的魔法工具

引言在当今数字化时代&#xff0c;数据已成为企业的核心资产&#xff0c;如同企业发展的 “燃料”&#xff0c;驱动着业务的增长与创新。从用户行为数据到业务运营数据&#xff0c;从市场趋势数据到供应链数据&#xff0c;每一个数据点都蕴含着巨大的价值&#xff0c;能够为企业…