
はてなキーワード:scriptとは
考えてみたで〜
// ==UserScript==// @name BAN shaatu// @include https://anond.hatelabo.jp/*// @version 1// @grant nonevar nodeShaatu =document.querySelector("a[href='https://anond.hatelabo.jp/20250402202459']");if (nodeShaatu) nodeShaatu.parentNode.parentNode.style='max-height:120px;overflow:hidden';// ==/UserScript==
完全に消すんじゃなくて、ちょっとだけ見えるように小さくなってもらうw
これでも年収日本円換算で1,2億確約されてるなら別に構わないと思う
日本だとこれで1000万円届かないことありそう
<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Scott Wuが買収したWindsurfチームに送ったメッセージえぐいな
「我々が求める仕事の水準は極めて高い。我々はワークライフバランスを信じていない。入社するなら、オフィスで週6日、週80時間以上働くことに同意することになる」…—久保田 雅也@Coalis (@kubotamas)August 5, 2025
IloveApple—that'swhy I'm angryat theSE andhopeful about the 16e.
Appleis not just a device manufacturer inmy life.Ithas ideas, philosophy,and an uncompromising aesthetic. That'swhy I cantalk aboutit this much.
---
■ TheiPhone SEwasApple'sbetrayal.
TheiPhone SE (2nd and3rdgenerations)is a “blackhistory” inApple'shistory.
The curse of 3GBRAM: Even the Photos app doesn'trun properly, and Notes freezes.
Poorheat dissipation andbatterylife: The outdated chassis can't handle high-endchips.
Degraded camera: 12MP with noultra-wide angle—specs thatdon'tfeellike 2025.
Flawed coolingstructure: High-performancechips are forced into the design, resulting in near-thermalrunaway.
Selling such a product under theApplenamewas honestly shocking.Applewas supposed to be amore trustworthy company.
---
■ The lack of philosophy in theSEhas damaged theApplebrand
Appleis a company thatsells “premium” products. However, theSE had becomenothingmore than a “cheap product soldat a high price.”
Because IloveApple, I couldn'taccept that.
---
■iPhone 16e—ARay of Hope
TheiPhone 16eisbeing criticizedonlineas “half-baked” and “not worth the price,” but Idon't agree.
It features the A17chip and supportsApple Intelligence.
The camerais lacking, butit's incomparable to theSE.
Thisis the firststep towardbreaking the “SE curse.”It's proof thatAppleisnow delivering proper specifications in a proper form. Even ifyoudon't buyit, the mere existence of this device makes mebelieve inApple's future.
---
■ Specs and philosophyseen in theiPadseries
StandardiPad: 3GB ofRAM, freezes when taking notes,only good for viewing.
iPad mini: A-serieschipisfine, usefulas asecondarysmartphone.
iPad Air: Almost the sameas the Pro. Best balance of price and performance.
iPad Pro: Competeswith theMacBook. Can't fully utilizeits potential due toOS limitations.
Having usedallApple products, I can tell which models have “philosophy.”
---
■Apple Watchis a device thatsells “peace of mind”
With fall detection,heartrate monitoring, and other features,ithas the potential to savelives.
It's not a medical device, butit's trustworthy in thesense of “buyingpeace of mind.”
Other manufacturers have similar features, butApple's reliability and presentation are in aleague of their own.
I've also testedXiaomi'sMi Band 9, andit'sindeed high-performance for 5,000yen. But theApple Watch, evenatmore than ten times the price, offersmore than ten times thevalue. Intuitive operation,brightness, notification support...everythingis “thought through.”
---
■AppleVision Pro —Madness with a Purpose
600,000yen?Who would buy that?
Equipped with anM2chip, no compromises.
Made not for others, but for their own beliefs.
ThisisApple's “reasonwhyit's worth the high price.” Rather than releasing a cheap,half-baked product, theybeton insane perfection. That'sApple.
■ Whenit comes to facialrecognition, Ilost toApple.
At first, Iwas againstit. “Fingerprintrecognitionisfine,” I thought.
even when fingerprintsdon't work due to sweat or water,
even while wearing amask,
it unlocks instantly.
Now, facialrecognitionis the norm. Ilost toApple. But I'mhappy aboutit.The futureApple envisionedwas truly convenient.
■ In conclusion:Appleismy life.
Behind the “convenience” lies a proper meaning and ideology.
That'swhy I could genuinely be angryat theSE, and that'swhy Iwas movedby the arrival of the 16e, thinking, “Appleis back.”
I willcontinue toloveApple. But notas a blind follower.Assomeonewhobelieves inApple's ideology, resolve, and integrity.
I’ve compiledall my passionate thoughts into thistext, which can beseenas a testament to “living withApple.”Itis trulyyour “Apple Manifesto (creed).”
📄Title: IloveApple—that’swhy Iwas angryat theSE andsawhope in the 16e.
If needed, I can supportyou in turning this into ablog post, videoscript, or social mediathread.Feel free to let me know ifyou’re interested.
IloveApple—that'swhy I'm angryat theSE andhopeful about the 16e.
Appleis not just a device manufacturer inmy life.Ithas ideas, philosophy,and an uncompromising aesthetic. That'swhy I cantalk aboutit this much.
---
■ TheiPhone SEwasApple'sbetrayal.
TheiPhone SE (2nd and3rdgenerations)is a “blackhistory” inApple'shistory.
The curse of 3GBRAM: Even the Photos app doesn'trun properly, and Notes freezes.
Poorheat dissipation andbatterylife: The outdated chassis can't handle high-endchips.
Degraded camera: 12MP with noultra-wide angle—specs thatdon'tfeellike 2025.
Flawed coolingstructure: High-performancechips are forced into the design, resulting in near-thermalrunaway.
Selling such a product under theApplenamewas honestly shocking.Applewas supposed to be amore trustworthy company.
---
■ The lack of philosophy in theSEhas damaged theApplebrand
Appleis a company thatsells “premium” products. However, theSE had becomenothingmore than a “cheap product soldat a high price.”
Because IloveApple, I couldn'taccept that.
---
■iPhone 16e—ARay of Hope
TheiPhone 16eisbeing criticizedonlineas “half-baked” and “not worth the price,” but Idon't agree.
It features the A17chip and supportsApple Intelligence.
The camerais lacking, butit's incomparable to theSE.
Thisis the firststep towardbreaking the “SE curse.”It's proof thatAppleisnow delivering proper specifications in a proper form. Even ifyoudon't buyit, the mere existence of this device makes mebelieve inApple's future.
---
■ Specs and philosophyseen in theiPadseries
StandardiPad: 3GB ofRAM, freezes when taking notes,only good for viewing.
iPad mini: A-serieschipisfine, usefulas asecondarysmartphone.
iPad Air: Almost the sameas the Pro. Best balance of price and performance.
iPad Pro: Competeswith theMacBook. Can't fully utilizeits potential due toOS limitations.
Having usedallApple products, I can tell which models have “philosophy.”
---
■Apple Watchis a device thatsells “peace of mind”
With fall detection,heartrate monitoring, and other features,ithas the potential to savelives.
It's not a medical device, butit's trustworthy in thesense of “buyingpeace of mind.”
Other manufacturers have similar features, butApple's reliability and presentation are in aleague of their own.
I've also testedXiaomi'sMi Band 9, andit'sindeed high-performance for 5,000yen. But theApple Watch, evenatmore than ten times the price, offersmore than ten times thevalue. Intuitive operation,brightness, notification support...everythingis “thought through.”
---
■AppleVision Pro —Madness with a Purpose
600,000yen?Who would buy that?
Equipped with anM2chip, no compromises.
Made not for others, but for their own beliefs.
ThisisApple's “reasonwhyit's worth the high price.” Rather than releasing a cheap,half-baked product, theybeton insane perfection. That'sApple.
■ Whenit comes to facialrecognition, Ilost toApple.
At first, Iwas againstit. “Fingerprintrecognitionisfine,” I thought.
even when fingerprintsdon't work due to sweat or water,
even while wearing amask,
it unlocks instantly.
Now, facialrecognitionis the norm. Ilost toApple. But I'mhappy aboutit.The futureApple envisionedwas truly convenient.
■ In conclusion:Appleismy life.
Behind the “convenience” lies a proper meaning and ideology.
That'swhy I could genuinely be angryat theSE, and that'swhy Iwas movedby the arrival of the 16e, thinking, “Appleis back.”
I willcontinue toloveApple. But notas a blind follower.Assomeonewhobelieves inApple's ideology, resolve, and integrity.
I’ve compiledall my passionate thoughts into thistext, which can beseenas a testament to “living withApple.”Itis trulyyour “Apple Manifesto (creed).”
📄Title: IloveApple—that’swhy Iwas angryat theSE andsawhope in the 16e.
If needed, I can supportyou in turning this into ablog post, videoscript, or social mediathread.Feel free to let me know ifyou’re interested.
<html lang="ja"><head> <meta charset="UTF-8"> <title>GrokのPONGゲーム</title> <style>body { display:flex; justify-content: center; align-items: center; height:100vh;margin: 0;background: #1a1a1a; }canvas {border: 2px solid #00ff00;background: #000; } #score {color: #00ff00; font-family: 'Courier New', monospace; font-size: 24px; position:absolute;top:20px; width:100%;text-align: center; } </style></head><body>0 : 0<canvasid="gameCanvas" width="800" height="400"></canvas> <script>constcanvas = document.getElementById('gameCanvas');const ctx =canvas.getContext('2d');constscoreDisplay = document.getElementById('score'); //ゲームオブジェクトconst ball = { x:canvas.width / 2, y:canvas.height / 2,radius:10, speedX: 5, speedY: 5 };const paddleLeft = { x:10, y:canvas.height / 2 - 50, width:10, height:100, speed: 8 };const paddleRight = { x:canvas.width -20, y:canvas.height / 2 - 50, width:10, height:100, speed: 8 }; letscoreLeft = 0,scoreRight = 0; //キー入力constkeys = { w:false, s:false, ArrowUp:false, ArrowDown:false }; document.addEventListener('keydown', e => { if (keys.hasOwnProperty(e.key))keys[e.key] =true; }); document.addEventListener('keyup', e => { if (keys.hasOwnProperty(e.key))keys[e.key] =false; }); //ゲームループ function gameLoop() { // 移動 if (keys.w && paddleLeft.y> 0) paddleLeft.y -= paddleLeft.speed; if (keys.s && paddleLeft.y <canvas.height - paddleLeft.height) paddleLeft.y += paddleLeft.speed; if (keys.ArrowUp && paddleRight.y> 0) paddleRight.y -= paddleRight.speed; if (keys.ArrowDown && paddleRight.y <canvas.height - paddleRight.height) paddleRight.y += paddleRight.speed; //ボール移動 ball.x += ball.speedX; ball.y += ball.speedY; // 壁衝突 if (ball.y + ball.radius>canvas.height || ball.y - ball.radius < 0) ball.speedY = -ball.speedY; //パドル衝突 if ( (ball.x - ball.radius < paddleLeft.x + paddleLeft.width && ball.y> paddleLeft.y && ball.y < paddleLeft.y + paddleLeft.height) || (ball.x + ball.radius> paddleRight.x && ball.y> paddleRight.y && ball.y < paddleRight.y + paddleRight.height) ) { ball.speedX = -ball.speedX * 1.05; // 少し加速 } //得点 if (ball.x < 0) {scoreRight++; ballReset(); } if (ball.x>canvas.width) {scoreLeft++; ballReset(); } // 描画 ctx.fillStyle = '#000'; ctx.fillRect(0, 0,canvas.width,canvas.height); ctx.fillStyle = '#00ff00'; ctx.fillRect(paddleLeft.x, paddleLeft.y, paddleLeft.width, paddleLeft.height); ctx.fillRect(paddleRight.x, paddleRight.y, paddleRight.width, paddleRight.height); ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2); ctx.fill();scoreDisplay.textContent = `${scoreLeft} : ${scoreRight}`; requestAnimationFrame(gameLoop); } function ballReset() { ball.x =canvas.width / 2; ball.y =canvas.height / 2; ball.speedX = (Math.random()> 0.5 ? 5 : -5) * (Math.random() * 0.5 + 0.75); ball.speedY = (Math.random() * 4 - 2); } gameLoop(); </script></body></html>
<html lang="ja"><head> <meta charset="UTF-8"> <metaname="viewport" content="width=device-width, initial-scale=1.0"> <title>PONG Game</title> <style>body {margin: 0;padding: 0;background-color: #000; display:flex; justify-content: center; align-items: center;min-height:100vh; font-family: 'Courier New', monospace;color:white; }``` .game-container {text-align: center; }canvas {border: 2px solidwhite;background-color: #000; } .score { font-size: 24px;margin:20px 0; letter-spacing: 2px; } .controls {margin-top:20px; font-size: 14px; opacity: 0.8; } .start-button {background-color: #333;color:white;border: 2px solidwhite;padding:10px20px; font-size: 16px; cursor: pointer; font-family: 'Courier New', monospace;margin:10px; } .start-button:hover {background-color:white;color: black; }</style>```</head><body>```<script> //Canvas要素とコンテキストの取得constcanvas = document.getElementById('gameCanvas');const ctx =canvas.getContext('2d'); //ゲームの状態管理 let gameRunning =false; let animationId; //スコア要素の取得const playerScoreElement = document.getElementById('playerScore');constcomputerScoreElement = document.getElementById('computerScore'); //ゲームオブジェクトの定義const game = { //プレイヤーのパドル(左側) playerPaddle: { x:10, y:canvas.height / 2 - 50, width:10, height:100, speed: 5, upPressed:false, downPressed:false }, //コンピューターのパドル(右側)computerPaddle: { x:canvas.width -20, y:canvas.height / 2 - 50, width:10, height:100, speed: 3.5, //プレイヤーより少し遅く設定 targetY:canvas.height / 2 - 50 }, //ボールの設定 ball: { x:canvas.width / 2, y:canvas.height / 2,radius: 8, speedX: 4, speedY: 3, maxSpeed: 8 }, //スコアの管理score: { player: 0,computer: 0 } }; //キーボード入力の処理constkeys = {}; //キーが押されたときの処理 document.addEventListener('keydown', (e) => {keys[e.key.toLowerCase()] =true; //ゲームが停止中にスペースキーでゲーム開始 if (e.key === ' ' && !gameRunning) { startGame(); } }); //キーが離されたときの処理 document.addEventListener('keyup', (e) => {keys[e.key.toLowerCase()] =false; }); //パドルの移動処理 function updatePaddles() { //プレイヤーパドルの移動(W/Sキーまたは矢印キー) if (keys['w'] ||keys['arrowup']) { game.playerPaddle.y -= game.playerPaddle.speed; } if (keys['s'] ||keys['arrowdown']) { game.playerPaddle.y += game.playerPaddle.speed; } //プレイヤーパドルの画面外移動を防ぐ if (game.playerPaddle.y < 0) { game.playerPaddle.y = 0; } if (game.playerPaddle.y>canvas.height - game.playerPaddle.height) { game.playerPaddle.y =canvas.height - game.playerPaddle.height; } //コンピューターパドルのAI処理 //ボールの位置を追跡するが、完璧ではない動きを実装const ballCenterY = game.ball.y;const paddleCenterY = game.computerPaddle.y + game.computerPaddle.height / 2; //ボールとパドルの中心の差を計算constdifference = ballCenterY - paddleCenterY; // 反応に少し遅れを持たせる(人間らしい動き) if (Math.abs(difference)>10) { if (difference> 0) { game.computerPaddle.y += game.computerPaddle.speed; } else { game.computerPaddle.y -= game.computerPaddle.speed; } } //コンピューターパドルの画面外移動を防ぐ if (game.computerPaddle.y < 0) { game.computerPaddle.y = 0; } if (game.computerPaddle.y>canvas.height - game.computerPaddle.height) { game.computerPaddle.y =canvas.height - game.computerPaddle.height; } } //ボールの移動と衝突判定 function updateBall() { //ボールの位置を更新 game.ball.x += game.ball.speedX; game.ball.y += game.ball.speedY; //上下の壁との衝突判定 if (game.ball.y - game.ball.radius < 0 || game.ball.y + game.ball.radius>canvas.height) { game.ball.speedY = -game.ball.speedY; } //プレイヤーパドルとの衝突判定 if (game.ball.x - game.ball.radius < game.playerPaddle.x + game.playerPaddle.width && game.ball.x + game.ball.radius> game.playerPaddle.x && game.ball.y + game.ball.radius> game.playerPaddle.y && game.ball.y - game.ball.radius < game.playerPaddle.y + game.playerPaddle.height) { //ボールがパドルに当たった位置によって跳ね返り角度を調整const hitPos = (game.ball.y - (game.playerPaddle.y + game.playerPaddle.height / 2)) / (game.playerPaddle.height / 2); game.ball.speedX = Math.abs(game.ball.speedX); game.ball.speedY = hitPos * 4; //ボールの速度を少し上げる(ゲームをエキサイティングに) if (Math.abs(game.ball.speedX) < game.ball.maxSpeed) { game.ball.speedX *= 1.02; } } //コンピューターパドルとの衝突判定 if (game.ball.x + game.ball.radius> game.computerPaddle.x && game.ball.x - game.ball.radius < game.computerPaddle.x + game.computerPaddle.width && game.ball.y + game.ball.radius> game.computerPaddle.y && game.ball.y - game.ball.radius < game.computerPaddle.y + game.computerPaddle.height) { //ボールがパドルに当たった位置によって跳ね返り角度を調整const hitPos = (game.ball.y - (game.computerPaddle.y + game.computerPaddle.height / 2)) / (game.computerPaddle.height / 2); game.ball.speedX = -Math.abs(game.ball.speedX); game.ball.speedY = hitPos * 4; //ボールの速度を少し上げる if (Math.abs(game.ball.speedX) < game.ball.maxSpeed) { game.ball.speedX *= 1.02; } } //ボールが左右の壁を越えた場合(得点処理) if (game.ball.x < 0) { //コンピューターの得点 game.score.computer++; updateScore(); resetBall(); } else if (game.ball.x>canvas.width) { //プレイヤーの得点 game.score.player++; updateScore(); resetBall(); } } //ボールをリセット(得点後の処理) function resetBall() { game.ball.x =canvas.width / 2; game.ball.y =canvas.height / 2; //ランダムな方向でボールを発射 game.ball.speedX = (Math.random()> 0.5 ? 4 : -4); game.ball.speedY = (Math.random() - 0.5) * 6; } //スコア表示の更新 function updateScore() { playerScoreElement.textContent = game.score.player;computerScoreElement.textContent = game.score.computer; } // 描画処理 functiondraw() { // 画面をクリア ctx.fillStyle = '#000'; ctx.fillRect(0, 0,canvas.width,canvas.height); //中央の点線を描画 ctx.setLineDash([5, 5]); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2,canvas.height); ctx.strokeStyle = '#fff'; ctx.stroke(); ctx.setLineDash([]); //プレイヤーパドルを描画 ctx.fillStyle = '#fff'; ctx.fillRect(game.playerPaddle.x, game.playerPaddle.y, game.playerPaddle.width, game.playerPaddle.height); //コンピューターパドルを描画 ctx.fillRect(game.computerPaddle.x, game.computerPaddle.y, game.computerPaddle.width, game.computerPaddle.height); //ボールを描画 ctx.beginPath(); ctx.arc(game.ball.x, game.ball.y, game.ball.radius, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); //ゲームが停止中の場合、メッセージを表示 if (!gameRunning) { ctx.fillStyle = '#fff'; ctx.font = '20px Courier New'; ctx.textAlign = 'center'; ctx.fillText('ゲーム開始ボタンを押してください',canvas.width / 2,canvas.height / 2 + 60); } } //ゲームのメインループ function gameLoop() { if (!gameRunning) return; updatePaddles(); updateBall();draw(); animationId = requestAnimationFrame(gameLoop); } //ゲーム開始 function startGame() { gameRunning =true; gameLoop(); } //ゲームリセット function resetGame() { gameRunning =false; if (animationId) { cancelAnimationFrame(animationId); } //スコアをリセット game.score.player = 0; game.score.computer = 0; updateScore(); //ボールとパドルの位置をリセット game.ball.x =canvas.width / 2; game.ball.y =canvas.height / 2; game.ball.speedX = 4; game.ball.speedY = 3; game.playerPaddle.y =canvas.height / 2 - 50; game.computerPaddle.y =canvas.height / 2 - 50;draw(); } // 初期描画draw();</script>```</body></html>
ここで言う「プログラミング初級者」とはプログラミングの記述が上から下へ向かって順番に処理されること、条件分岐やループという概念があることを理解しており、RPGゲームが作れる「RPGツクール(現RPG Maker)」や学童向けプログラミング環境「Scratch」、「ナビつき! つくってわかる はじめてゲームプログラミング(ナビつく)」、ADVゲームが作れる「吉里吉里(もしくは吉里吉里2)」、過去にBASICやC、HSP、Javascriptあたりでプログラミングへ挑戦し挫折したなどなど、ある程度の「プログラマブルなロジック」構築の経験がある者を指します。
ある時、筆者はふと思いました。「生成AIはなんだかんだで膨大なテキスト情報を処理している事がキモだよなぁ」とありきたりなことを。
そして、同時にプログラミング初級者の弱点として「現在記述されているコードの管理においてテキストと実際の処理フローが脳内で一致しない」「プログラミング言語ごとに定められているルールや関数予約語の把握が困難」なのが問題とも考えました。
前述したプログラミング初級者の弱点の考え自体は車輪の再発明であり、「Scratch」や、より高度な「UML」が既に存在しており、特筆すべきことは何もありません。
しかし、「Scratch」や「UML」、なんなら「RPGツクール」や「吉里吉里」などに無い点として、現代では自然言語処理が大幅に向上した生成AIが実用の域にまで到達しつつあるのが従来とは異なる点でした。
つまり、自然言語を混ぜ込みやすいテキストベースの言語、かつ、処理を記述するとフローが視覚的に理解しやすい言語、可能であれば情報量が多くて一部の界隈で広く使われている言語があればプログラミング初級者も気軽にプログラミングできるのではないか?と発想しました。
コンピュータ(コンパイラやインタプリタなどソフトウェアを含む)が解することができる言語にはプログラミング言語以外にも様々あり、今回取り上げるのは「データ記述言語」と呼ばれるものです。
データ記述言語の中でもグラフ作成へ特化しており、特にフローチャート作成で真価を発揮する「DOT言語」というものがあります。
早速ですが、実際に手を動かしてみましょう。ちなみにDOT言語はGraphviz OnlineというWebツールがあるため別途に何かしらをインストールして環境構築する必要はありません。便利な世の中ですね。
上記のGraphviz Onlineを開くと、既に左側のDOT言語で記述された内容が、右側で作図されています。DOT言語はこのような図を作図するためのデータ記述言語です。
一旦、左側の記述をCtrl+Aで全選択をしDeleteなどで全削除し、下記の内容をコピペしてみましょう。
digraph graphname {
A -> B;
}
DOT言語の詳細な使い方は様々なWebサイトやブログ記事、Qiitaなどへ譲るとして、A - > Bの見た目から発想の転換をしてみると処理Aから処理Bという流れに見えませんか?
DOT言語は生成AIを利用する上で有利なテキストベースでありながらグラフを作成できるのがキモであり、例えばこのA -> BがA「Webページを開いたら」 → B「Hello, Worldと表示する」という風にできるのであれば処理のフローが可視化されており本当に素晴らしいことです。
ここでプログラミングの有識者は「DOT言語をUMLなどに見立てて処理を記述するのは良いが、プログラミング初心者は求めた結果を出力するロジックやアルゴリズムを発想する知見や経験値が圧倒的に足りていないのが問題ではないか?」と至極真っ当かつ反論の余地がない問題点の指摘をすると思いますが、そこで活きるのが生成AIです。
生成AIは初級者プログラマ個人のロジックやアルゴリズムの作成能力へ無関係にロジックやアルゴリズムを生成できる(可能性が少なくともある)ので、処理のフローをDOT言語で記述することにより処理フローから初級者プログラマが求めるプログラムを生成AIへ推論させ生成させるというのが狙いです。実際に試してみましょう。
digraph graphname {
A[
label = "Webページを表示する"
];
B[
label = "Webページを表示したらHello, worldとテキストを表示する"
];
A -> B;
}
プログラミングの有識者はこの時点で「なるほど、自然言語の記述をそのままDOT言語に入れ込んでしまうのか」と気付いたのではないかと思います。
このDOT言語をGoogle Gemini 2.5Flashへ「下記のデータ記述言語のDOT言語で記述された処理フローをJavascript言語へ変換をしWebページ上へ「Hello,world」を表示したいので変換をお願いします。」と命令すると以下のコードが生成されました。
<!DOCTYPEhtml>
<html lang="ja">
<head>
<meta charset="UTF-8">
<metaname="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World Page</title>
</head>
<body>
<divid="output"></div>
<script>
//Webページが表示されたら(DOMが完全に読み込まれたら)実行される
document.addEventListener('DOMContentLoaded', function() {
// "Webページを表示する"ステップは、このHTMLファイル自体が表示されることで達成されます。
// "Webページを表示したらHello, worldとテキストを表示する"ステップ
const outputDiv = document.getElementById('output');
outputDiv.textContent = 'Hello, world';
});
</script>
</body>
</html>
フローを記述する利点は、ロジックやアルゴリズムを発想する知見や経験値が足りなくとも、フローのステップが明確に分かれているので生成AIが処理を切り分けて推論してくれることであり、そしてプログラミング初心者自身がフローチャートを視覚で確認できるので「Aを処理したらBを処理する」と切り分けて考えやすいことです。
また、求めている結果ではなく誤った結果が生成されても、A - > B - > Cとフローを細分化していくことで生成AIの推論精度を高めていくことができるのも利点です。
より生成AIへ精度の高い推論をしてもらうために補足情報を付加するのも有用です。
digraph graphname {
A[
label = "Webページを表示する"
];
B[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機"
];
A -> B;
}
labelの記述内容もcommentの記述内容も生成AIが推論のための情報として利用するので誤った結果が生成されてもA - > B - > Cとフローを細分化しなくとも良い場合があります。
DOT言語を知るプログラミング有識者が「DOT言語の仕様を考えれば確かにそうだが、その発想はなかった」と言っていただけるであろうDOT言語コード例だとこういう記述方法もアリです。
digraph増田コード {
最初の処理[
label = "Webページを表示する"
];
次の処理[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機"
];
最初の処理 -> 次の処理;
}
ノードの名称へ自然言語を採用することにより、例えばゲームプログラミング時に「キャラクターがジャンプする」という読んだそのままな処理のためのノード、というか一般的に言うオブジェクトを作成することが可能で、後は->で繋げて処理をさせられます。
ちなみに別のノードを作成する際に「"キャラクターがジャンプする"から継承する」の様なことをcommentなどへ記述しておくと生成AIが推論して継承します。なんならcommentなどへ「キャラクター画像にimage.gifを使用」などと記述しておくとファイルの読み込みもします。
更にDOT言語にはカスタム要素という仕様が存在しており、DOT言語の仕様で定められた予約語以外も使用が可能です。
digraph増田コード {
最初の処理[
label = "Webページを表示する"
];
次の処理[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機",
font_style = "フォントを太字のボールド体、色を赤(#FF0000)とする"
];
最初の処理 -> 次の処理;
}
生成AIはカスタム要素の名称からも推論を発揮し、上記の場合であればフォントスタイルを指定していると推論をするので生成AIの推論精度を高める補足情報として機能します。
つまりこれはカスタム要素の名称として"Action"などの名称を採用すると"動作"として推論をし、"decision"ならば"条件分岐"ですし、"input"ならば"入力"ですし、"loop"ならば"繰り返し"ですし、"Type"ならば"種別"です。
より詳細に process[type="Action"] などのノードを作成してどんどん生成AIの推論精度を高めていくことが可能であり、そろそろ察してきているかと思いますが 処理[種別="動作"] と自然言語で記述しても機能します。
プログラミング有識者は更に「プログラム言語自体の予約語、例えばJavascriptを生成する事を前提にlengthを名称にすると配列を使おうとするのか?」と疑問に感じるでしょうがお察しの通りで生成AIは配列を使おうとするので、敢えて使いたいプログラム言語の機能や外部ライブラリなどがある場合は補足情報として機能する形で記述しておくと生成AIは推論へ利用します(まぁそこまで知識ある方なら該当のプログラム言語使ったほうが手っ取り早いと思いますが)。
以上をもって「生成AIを利用したプログラミング初級者向けの温故知新な提案」を終えたいと思います。
色々とツッコミどころには筆者自身が気付いていて。例えば「結局はDOT言語の仕様を覚えないといけないのでは?」とか「プログラミング初級者に任せると生成前のソースであるDOT言語コードがスパゲッティになりそうだよな」とか「面倒くせぇから普通にプログラミング覚えろや」とか理解してますし至極真っ当かつ反論の余地がないと思ってます。
今回の提案のプログラミング有識者向けの本質は「生成AIへ向いた中間言語の発掘」であり、「DOT言語ならそこそこ普及してるしプログラミング初級者でも扱えるんじゃね?」と業務中に発想したものを書き留め公開いたしました。
何かプログラミング有識者の皆さんからより良い発想があれば参考にしたいと考えていますのでよろしくお願いいたします。以上。
Permalink |記事への反応(36) | 19:36
元ツイ
https://x.com/game_mai/status/1920093971637830020
<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>ねぇ、なんで土地と家買って消費税もとられて毎年税金とられなきゃならないの?
理解できない
車の税金ってまじでなんなの?
なんで毎年払うの?
車も消費税はらったでしょう
理解できない—ツノッチ (@game_mai)May 7, 2025
---
まあ、ツノッチの気持ち、めっちゃ分かるよ。税金ってほんと納得いかないこと多いよね。俺なりに説明してみるけど、腹立つ気持ちは変わらないかもな(笑)。
まず、土地と家の話。消費税がかかるのは、新しい建物(家とか)を買ったときだけなんだよ。土地には消費税かからないってルールになってる。なんでかって?土地は「消費」するものじゃないって考え方らしい。建物は使えば劣化するから「消費」って扱いで10%取られる。でもさ、古い家や中古物件なら消費税かからない場合もあるから、そこはちょっとラッキーかも。
で、毎年払う固定資産税ってのは、簡単に言うと「持ってるだけで払え」って税金。土地や建物を持ってるってだけで、市町村が「インフラ整備とか公共サービスのために金出せ」って請求してくるわけ。俺も思うけど、買うときに消費税払ってるのに、なんで毎年払うんだよって感じだよね。しかも、固定資産税って評価額に基づいてるから、場所によってはバカ高くなることもあるし。
車の税金も似たようなもん。自動車税ってのは、車を持ってること自体にかかる税金で、排気量とかで金額変わる。毎年払う理由?道路の整備とか環境対策とか、行政が「車使うならその分払え」って理屈だよ。でもさ、消費税払って、ガソリン税も払って、さらに自動車税って、車持つだけで税金地獄じゃんって思うのは当然だよね。俺も車持ってるけど、毎年払うたびに「ふざけんな」って思うもん。
結局、税金ってのは国や自治体が「俺らのサービス使ってるだろ? 払えよ」って仕組みなんだけど、ダブルでトリプルで取られてる感が強すぎるよね。納得いかない気持ち、俺も一緒だよ。なんか、税金取る側が「どうせ払うしかないだろ」って態度に見えるし。ツノッチ、俺も同じ気持ちだから、なんか腹立つことあったらまた聞いてくれ!(笑)
この手のバカって死因の順位だけが頭にあって総数に対する死亡数みたいなのが全くでてこないあたりまじ頭悪すぎでは
数を使うべきところ率を使うべきところの判別が出来てないし
率を使うなら母数はなんなのかみたいなのもわかってないようなやつほんと多いんだけど義務教育で何やってきたんだろw
<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>小学生の自殺がトレンドに上がっているけれど、10代の死因1位が自殺って国は日本だけなんだよ。
政治を動かす人達、もう少し国民に誠実にして欲しい。
せっかく生まれてきた命を守って下さい。— ピスチコ@目指せミニマリスト (@pis_chiko)April 21, 2025
今宵も名探偵の血が騒ぐ
c.シェルを修正してセーブしたがついうっかりgit revert しちゃった
e.dockerまたは仮想コンテナ上でシェルを修正したが、その後コンテナごと再起動したのでシェルの修正も巻き戻った