<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.yz-learning.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Yz-Learning Base Wiki - game-engineer:classes:2024:game-ai</title>
        <description></description>
        <link>https://wiki.yz-learning.com/</link>
        <lastBuildDate>Sat, 04 Apr 2026 13:13:32 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://wiki.yz-learning.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>Yz-Learning Base Wiki</title>
            <link>https://wiki.yz-learning.com/</link>
        </image>
        <item>
            <title>簡単なソース</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-10-01-2-sub&amp;rev=1728349128</link>
            <description>簡単なソース


﻿# include &lt;Siv3D.hpp&gt; // Siv3D v0.6.14

const Size BLOCK_SIZE{ 32, 32 };
const Size MazeSize{ 21, 15 };//サイズは奇数でなければいけない

enum OBJS
{
	WALL, BAR, FLOOR, MAX_OBJS
};

//二次元配列　MazeData[MazeSize.y][MazeSize.x]{FLOORで初期化｝
std::vector&lt;std::vector&lt;int&gt;&gt; MazeData(MazeSize.y, std::vector&lt;int&gt;(MazeSize.x, FLOOR));


void MakeWall(int w, int h);
void MakeMaze(int w, int h);
void PushDownBar(int w, int h);
void DrawMaze(int w, int h);

//w, h 迷路の幅と高さ
void MakeMaze(int w, int h)
{
	MakeWall(w, h);…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 08 Oct 2024 00:58:48 +0000</pubDate>
        </item>
        <item>
            <title>迷路を作ろう</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-10-01-2&amp;rev=1728348970</link>
            <description>迷路を作ろう

AIで云々するプログラムを作っていく前に、そん時に使う迷路のフィールドを作ってみよう。

授業でも見せたけど、迷路（ダンジョン）の自動生成にはいろんなものがあり、簡単そうなのから難しそうなものもろもろある。</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 08 Oct 2024 00:56:10 +0000</pubDate>
        </item>
        <item>
            <title>木のトラバーサル</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-10-08-2&amp;rev=1730185270</link>
            <description>木のトラバーサル

DFSとBFS


#include &lt;iostream&gt;
#include &lt;queue&gt;
#include &lt;stack&gt;

namespace
{

}

struct Node
{
	float value;//木のノードの持つ値
	int num;//ノード番号
	Node* left;//左の子
	Node* right;//右の子
};

//numは自動で増える
Node* makeNode(float value)
{
	static int n = 0;
	Node* p = new Node{ value, n, nullptr, nullptr };
	n++;
	return p;
}

void PrintNode(Node* node)
{
	//自分のノード番号、左の子のノード番号、右の子のノード番号を表示
	int myNum = node-&gt;num;
	int leftNum = -1, rightNum = -1;
	if (node-&gt;left != nullptr)
		leftNum = node-&gt;left-&gt;num;
…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 29 Oct 2024 07:01:10 +0000</pubDate>
        </item>
        <item>
            <title>リスト構造をつくってみたよ</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-10-23-4&amp;rev=1729663614</link>
            <description>リスト構造をつくってみたよ


#include &lt;iostream&gt;

using namespace std;


struct Point 
{
	int x;
	int y;
};

struct PointList
{
	Point p;
	int num;
	PointList* pNext;
};
//自己参照構造体


void PrintDat(const PointList&amp; _pl)
{
	cout &lt;&lt; &quot;(&quot; &lt;&lt; _pl.p.x &lt;&lt; &quot;,&quot; &lt;&lt; _pl.p.y &lt;&lt; &quot;) : num = &quot; &lt;&lt; _pl.num &lt;&lt; endl;
	if (_pl.pNext == nullptr)
		cout &lt;&lt; &quot;pNext:nullptr&quot; &lt;&lt; endl;
}

void PrintDat(PointList* _pl)
{
	cout &lt;&lt; &quot;(&quot; &lt;&lt; _pl-&gt;p.x &lt;&lt; &quot;,&quot; &lt;&lt; _pl-&gt;p.y &lt;&lt; &quot;) : num = &quot; &lt;&lt; _pl-&gt;num &lt;&lt; endl;
	if (_pl-&gt;pNext == nullptr)
		cout &lt;&lt;…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 23 Oct 2024 06:06:54 +0000</pubDate>
        </item>
        <item>
            <title>リスト構造の生成と挿入と削除</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-10-29-2&amp;rev=1730175569</link>
            <description>リスト構造の生成と挿入と削除


#include &lt;iostream&gt;

namespace
{
	const int DATASIZE = 5;//生成するデータ数
}


struct Point
{
	int x;
	int y;
};

struct myList
{
	Point pos;
	int num; //データ1個作ったら勝手に増えてほしい
	myList* pNext;
};

void InsertData(myList *head, int num, myList* data) //numの後ろにデータdataを挿入
{
	myList* p = head;
	while (p != nullptr)
	{
		if (p-&gt;num == num)
		{
			myList* tmp = p-&gt;pNext;
			p-&gt;pNext = data;
			data-&gt;pNext = tmp;
			break;
		}
		else
			p = p-&gt;pNext;
	}
	return;
}
void InsertData(myList* head, in…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 29 Oct 2024 04:19:29 +0000</pubDate>
        </item>
        <item>
            <title>穴掘り法再び（探索もするよ）</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-11-19-2&amp;rev=1731989220</link>
            <description>穴掘り法再び（探索もするよ）

迷路探索課題

	*  迷路作って、表示できる
	*  左上と右下にStartとGoalを設置
	*  幅優先探索と深さ優先探索で、スタートからゴールまでの道のりを調べる</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 19 Nov 2024 04:07:00 +0000</pubDate>
        </item>
        <item>
            <title>ダイクストラ法を実装しようズ</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2024:game-ai:2024-12-17-2&amp;rev=1734401130</link>
            <description>ダイクストラ法を実装しようズ


# include &lt;Siv3D.hpp&gt; // Siv3D v0.6.14
#include &lt;numeric&gt;
#include &lt;stack&gt;
#include &lt;queue&gt;
#include &lt;map&gt;

using std::pair;


const Size BLOCK_SIZE{ 32, 32 };//ブロック一個の表示の大きさ
const Size MazeSize{ 25, 19 };//サイズは奇数でなければいけない
const Point Start{ 1,1 };
const Point Goal{ MazeSize.x - 2, MazeSize.y - 2 };
const float Div{ 5.0 }; //何段階でウェイト（コスト）を分割するか

const Vec2 dirs[4]{ {0,1},{0,-1},{1,0},{-1,0} };

enum OBJS
{
	WALL, BAR, FLOOR, START, GOAL, MAX_OBJS
};

struct floorData
{
	OBJS typ…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 17 Dec 2024 02:05:30 +0000</pubDate>
        </item>
    </channel>
</rss>
