【已开奖】过节啦!TiDB 社区第五届 1024 程序员心愿节|参与活动即可获得 1024 定制款卫衣、毛毯、免费考证兑换券等丰富礼品!

// happy 1024
public class ProgrammerDayGreeting {
public static void main(String args) {
// 艺术字标题
String title =
" ____ _ _ _ _ _ \n" +
" | _ \| | | | | | | | | | \n" +
" | |) | | __ _ __| | __ _ | || |__ | | \n" +
" | _ <| |/ / _ |/ ` | | _| ’ \ / _ \ | \n" +
" | |
) | | (
| | (
| | (
| | | |
| | | | / | \n" +
" |___/||\
,|\__,|\,_| \|| ||\__|| \n";
// 祝福语
String greetings = {
:sparkles: 祝所有程序员:”,
:tada: 1024程序员节快乐!”,
:computer: 代码无Bug,”,
:rocket: 需求不改稿,”,
:books: 学习进步,”,
:trophy: 技术飙升,”,
:dart: 升职加薪!”,
“”,
“愿你的每一行代码都充满力量!”,
“Happy 1024 Programmers’ Day! :confetti_ball:
};
// 打印标题
System.out.println(“\033[36m” + title + “\033[0m”);
// 打印祝福语
for (String line : greetings) {
// 随机颜色
String colorCode = getRandomColor();
System.out.println(colorCode + line + “\033[0m”);
try {
Thread.sleep(300); // 添加延迟效果
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
// 生成随机颜色代码
private static String getRandomColor() {
String colors = {
“\033[31m”, // 红色
“\033[32m”, // 绿色
“\033[33m”, // 黄色
“\033[34m”, // 蓝色
“\033[35m”, // 紫色
“\033[36m” // 青色
};
return colors[(int)(Math.random() * colors.length)];
}
}