こんにちは、アイカレの非常勤講師をしている山内といいます。
今回、ChatGPTを活用してちょっとしたwebアプリを作成しましたので紹介します。
「バドミントンのスコアをつける Web アプリを作りたい!」
そんな軽い思いつきからスタートしたのですが、
ChatGPT とやり取りしながらつくっているうちに、
気づけば 公式ルール対応スコアアプリ が完成していました。
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
| <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: content: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"> | |
| <script src="components/loader.js"></script> | |
| <link rel="stylesheet" href="components/loader.css"> | |
| <link rel="stylesheet" href="css/style.css"> | |
| <script> |
| public int [] ex4_8(int [] a, int idx, int n){ | |
| int num[] = new int[idx]; | |
| ArrayList<Integer> hoge = new ArrayList<Integer>(); | |
| for(int i=0;i<= a.length-1;i++){ | |
| hoge.add(a[i]); | |
| } | |
| // | |
| for(int j= idx;j< n+idx;j++){ | |
| if (idx != n) { |
| /** | |
| * | |
| * @param a - 整数型の配列 | |
| * @param idx - 削除の開始の添字 | |
| * @param n - 削除する要素数 | |
| * @return | |
| * 配列aのidxの位置からn個の要素を削除した配列を | |
| * 返す | |
| * 但し、削除できない場合は元の配列を返す | |
| */ |
| sudo find /var/ -type f -exec du \{\} \; | sort -nr | head -n 5 |
| #!/bin/bash | |
| thisyear=$(date '+%Y') # 今年の年 | |
| birthday=$(date -d "${thisyear}${1}" '+%s') # 今年の誕生日のエポック | |
| today=$(date '+%s') # 本日のエポック | |
| if [ "$birthday" -gt "$today" ]; then | |
| echo $(((birthday - today) / (60*60*24) + 1)) | |
| elif [ $(date '+%m%d') = "${1}" ]; then |
| drop procedure if exists tb1X; | |
| delimiter // | |
| create procedure tb1X(in x varchar(100)) | |
| begin | |
| set @s = concat('drop table if exists `', x ,'`'); | |
| prepare stmt from @s; | |
| execute stmt; | |
| deallocate prepare stmt; |