<?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:2022:game-programing-1:first-term:9</title>
        <description></description>
        <link>https://wiki.yz-learning.com/</link>
        <lastBuildDate>Sat, 04 Apr 2026 16:26:48 +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:2022:game-programing-1:first-term:9:9-01-1&amp;rev=1662097280</link>
            <description>リスト構造

ハッシュテーブルを作る際に、ハッシュ値が被った時の処理を考えると、

自由に要素を追加可能なデータ構造が欲しくなるよね



こんなかんじの
list[0]:〇→〇
list[1]:〇→〇→〇
list[2]:〇
list[3]:〇→〇
list[4]:〇→〇→〇
list[5]:〇
list[6]:〇→〇
list[7]:〇</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 02 Sep 2022 05:41:20 +0000</pubDate>
        </item>
        <item>
            <title>リストの続き</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-02-3&amp;rev=1662334843</link>
            <description>リストの続き


リスト構造
・リンクリスト
・連結リスト
・リスト

アドレスは配列と違い、並んでいない！

〇配列の場合
符号なし 8bit整数
unsigned char arr[5] = {1, 2, 3, 4, 5};（固定長のデータ構造）

 Addr    Addr    var     val  binary     size 
0x0003～0x000A  arr[0] ← 1  00000001 (8bit 1byte)  
0x000B～0x0012  arr[1] ← 2  00000010 (8bit 1byte)
0x0013～0x001A  arr[2] ← 3  00000011 (8bit 1byte)
0x001B～0x0022  arr[3] ← 4  00000100 (8bit 1byte)
0x0023～0x002A  arr[4] ← 5  00000101 (8bit 1byte)

〇リストの場合
h→1→3→5→7→NULL
.next　にはそのリスト要素の次の要素のアドレスが格納
.data  にはそのリスト要素の値が格納
データを…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 04 Sep 2022 23:40:43 +0000</pubDate>
        </item>
        <item>
            <title>リストの操作（まとめ）</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-04-12&amp;rev=1662360357</link>
            <description>リストの操作（まとめ）

C++でレコード型を使う（構造体のことだよ）

構造体

構造体の初期化と、データアクセス法


#include &lt;iostream&gt;
#include &lt;string&gt;

using std::cout;
using std::cin;
using std::endl;
using std::string;

struct profile
{
	string name;
	int gender; //0:男, 1:女, 2：その他
	int age;
	float height;
	string job;
};

void printProfile(profile _dat)
{
	//if(_dat.gender == 0) cout &lt;&lt; &quot;男&quot; &lt;&lt; endl;
	//else if(_dat.gender == 1)cout &lt;&lt; &quot;女&quot; &lt;&lt; endl;
	//else cout &lt;&lt; &quot;その他&quot; &lt;&lt; endl;
	
	string gen[3] = {&quot;男&quot;, &quot;女&quot;, &quot;その他&quot;};
	cout &lt;&lt; &quot;=+=+=+=+=+  profil…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 05 Sep 2022 06:45:57 +0000</pubDate>
        </item>
        <item>
            <title>トランプを表す構造体を作って初期化して表示する</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-06-25&amp;rev=1662434348</link>
            <description>トランプを表す構造体を作って初期化して表示する


#include &lt;iostream&gt;
#include &lt;list&gt;
#include &lt;string&gt;
using std::cout;
using std::cin;
using std::endl;
using std::string;

//H:ハート D:ダイヤ C:クラブ S:スペード J:ジョーカー
//string mark[5] ={ &quot;H&quot;, &quot;D&quot;, &quot;C&quot;, &quot;S&quot;, &quot;B&quot; };
string mark[5] = { u8&quot;♥&quot;, u8&quot;♦&quot;, u8&quot;♣&quot;, u8&quot;♠&quot;, u8&quot;B&quot; };
//A 2～10 J Q K, Bで表示
string num[14] = { &quot;B&quot;,&quot;A&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,
				   &quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;10&quot;,&quot;J&quot;,&quot;Q&quot;,&quot;K&quot; };//最後まで書いてみる

struct card
{
	int suit;   //スート 0:H 1:D 2:C 3:S 4:B 0～4
	int number; //数字 0:J 1:A 2:2 ... 1…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 06 Sep 2022 03:19:08 +0000</pubDate>
        </item>
        <item>
            <title>今のところのトランプゲーム</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-07-56&amp;rev=1662597290</link>
            <description>・ハッシュ探索法
　ハッシュテーブルの配列による実装（かぶり無し）
　ハッシュテーブルをリストで実装
・リスト構造の話（連結リスト、リンクリスト、リンクトリスト）
　→単方向リスト forward_list(単方向、前方追加型リスト）
　→双方向リスト list（双方向、前方・後方追加型リスト）
  →循環リスト　 ????
　　⇒前方追加型
　　　常に前にデータを追加
　　⇒後方追加型
　　　常に後ろにデータを追加
・構造体（C/C++でレコード型を表現するモノ）
　複数の型をパックして新しい型として使える
  例）
　　ベクトル型　座標（整数）と長さ（原点からの長さ）
　struct vector2D{
     int x, y; //座標
     double l; //長さ
  };
　vector2D p1,p2,p3;
  vector2D p[5];

  トランプを表してみようよ

　トランプ
　　・マーク（♥♦♣♠：suit）
　　・数字　（A,2～10,J,Q,K)
  ⇒コンピュータプログラムの上でどのような表し方をするか
　　モデリング：現実世界のものをコン…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 08 Sep 2022 00:34:50 +0000</pubDate>
        </item>
        <item>
            <title>アルゴリズム試験範囲</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-09-4&amp;rev=1663033502</link>
            <description>アルゴリズム試験範囲

まだやってないところも書いてあるので、このうちやったところをチェックしておいてください。


	*  ゲームアルゴリズム（４０４）
	*  試験日時：９月２０日（火）　９：００～１０：１０</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 13 Sep 2022 01:45:02 +0000</pubDate>
        </item>
        <item>
            <title>探索(Searching)</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-09-12&amp;rev=1662956106</link>
            <description>探索(Searching)

探索処理（サーチング、サーチ、search)

・有限のデータの中から、目的のデータを探す事


	例：配列を走査して、目的の値を見つける
	　 int iarray[10]={2, 5, 8, 1, 4, 7, 3, 6, 9, 0};
	                   0  1  2  3  4  5  6  7  8  9 ← index
           キー値６を探せ！　indexの０からたどっていき、index7でキー値6を見つけたよ。
　　　　　　探索結果　＝＞　iarray[7]が６に一致</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 12 Sep 2022 04:15:06 +0000</pubDate>
        </item>
        <item>
            <title>forward_listをつかって、hashTableを作ってみよう</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-09-45&amp;rev=1663040100</link>
            <description>forward_listをつかって、hashTableを作ってみよう


#include &lt;iostream&gt;
#include &lt;forward_list&gt;
#include &lt;string&gt;

using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::forward_list;

//値 _x がどこのindexに収まるか計算するハッシュ関数
//戻り値：　0～7
int Hash(int _x)
{
	return(_x % 8);
}
// データ列　[ 26, 53, 59, 84, 142, 161, 175, 178, 179 ]　これをハッシュテーブルに収める
const int datsize = 9;
int dats[datsize] = { 26, 53, 59, 84, 142, 161, 175, 178, 179 };

int main()
{
	forward_list&lt;int&gt; hash_t[8]; 
	//教科書では空かどうか判定するために配列を…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 13 Sep 2022 03:35:00 +0000</pubDate>
        </item>
        <item>
            <title>選択ソート</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-13-2&amp;rev=1663036887</link>
            <description>選択ソート


選択ソートのアルゴリズム
・昇順ソートの場合
・乱雑な数値列のなかから最小値を見つける
・最小値をソート済みの配列によけておく
・残りの数値列から最小値を見つける
・最小値をソート済みの配列によける
・以下繰り返し

 0  1  2  3  4  5  6  7  8  9
69 15 89 68 58 67 96 49  9 27 &lt;-乱雑な数値列 n[10]
XX XX XX XX XX XX XX XX XX XX &lt;-並べ替え用作業領域 w[10]

w[0] = n[8]
 0  1  2  3  4  5  6  7  8  9
XX 69 15 89 68 58 67 96 49 27  &lt;-乱雑な数値列 n[10]
 9 XX XX XX XX XX XX XX XX XX &lt;-並べ替え用作業領域 w[10]

w[1] = n[2]
 0  1  2  3  4  5  6  7  8  9
XX XX 69 89 68 58 67 96 49 27  &lt;-乱雑な数値列 n[10]
 9 15 XX XX XX XX XX XX XX XX &lt;-並べ…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 13 Sep 2022 02:41:27 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-14-5&amp;rev=1663139323</link>
            <description>プログラミングⅠ
10進数2進数16進数　できるように結構出るかもよ？
signed unsignedの違いも分かるようにね！
条件式の書き方　複合条件　かけるように
true false 判定
int a = 0;
 !a は　true? false?
(C/C++ は　0はfalse それ以外はtrueというルールがあるよ）
a= -1 if(a){}とかあったら、aはtrueになります 
!の使い方
bool a=true;
if(!a) //aの否定ってなんだっけ？
{
 
}

関数の仮引数、実引数
関数の書き方

アルゴリズム
バブル、挿入、選択３つのソートは確実に理解すること！
番兵法！…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 14 Sep 2022 07:08:43 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2022:game-programing-1:first-term:9:9-15-1&amp;rev=1663204086</link>
            <description>[課題のPDF]

③の条件が終了条件になっちゃってるので注意してください（陽悦のミス）


①のソースだけ書いておきます。



#include &lt;iostream&gt;
using std::cout; using std::cin; using std::endl;

void printArray(int _arr[], int _n)
{
	for(int i=0;i&lt;_n;i++)
	{
		cout &lt;&lt; _arr[i] &lt;&lt; &quot; &quot;;		
	}
	cout &lt;&lt; endl;
}

void sort1(int _arr[], int _n)
{
	for(int i=1; i&lt;_n-1; i++)
	{
		int v = _arr[i];
		int j = i - 1;
		while(j &gt;= 0 &amp;&amp; _arr[j] &gt; v)
		{
			_arr[j+1] = _arr[j];
			j--;
		}
		_arr[j+1] = v;
		printArray(_arr, _n);
	}
}
int main() {
	const int datnum = 9…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 15 Sep 2022 01:08:06 +0000</pubDate>
        </item>
    </channel>
</rss>
