<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.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:2023:game-programing-1:first-term:5</title>
        <description></description>
        <link>https://www.yz-learning.com/</link>
        <lastBuildDate>Sat, 04 Apr 2026 04:38:20 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.yz-learning.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>Yz-Learning Base Wiki</title>
            <link>https://www.yz-learning.com/</link>
        </image>
        <item>
            <title>選択構造のバリエーション</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-01-1245&amp;rev=1682998418</link>
            <description>選択構造のバリエーション

３つの基本構造のうち、順次構造と選択構造を学びました。

選択構造は、C++ではif文で表すことができることも学習済みだと思います。


if文


if(条件式)
{
    trueの時の処理のブロック
}
else
{
    falseの時の処理のブロック
}

//例：奇数か偶数かで、処理を分ける
int var;
cin &gt;&gt; var;

if(var%2 == 0)
{
    cout &lt;&lt; &quot;var は偶数です&quot; &lt;&lt; endl;
}
else
{
    cout &lt;&lt; &quot;var は奇数です&quot; &lt;&lt; endl;
}…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 02 May 2023 03:33:38 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-08-12&amp;rev=1683513588</link>
            <description>今開いているソリューションに、projectを一個追加
プロジェクト名は「rehabili」
ソースコードを追加、ソースコード名は「theMain.cpp」
いつものテンプレを記述

練習問題（それぞれproject作ってね）
カウンタ式のwhile文を使って以下の処理をするプログラムを書きなさい。
ex１．10回&quot;大事なことだから何度も言います。&quot;と改行付きで表示
ex２．cinで入力した回数（正の整数）&quot;hello, world&quot;を表示
ex３．1~100の総和(summation)を表示する処理
ex４．1～100を数える間３の倍数の時だけ&quot;アホ&quot;と表示する

ヒント：
まず、カウンタ変数と初期値を考える。
次に下の形を完成させる（条件を考える）
while文は条件を「満たしている間」実行されるよ！
while(条件)
{
  //処理内容
    //カウンタを増やす（減らす）
}
カウンタを増やすタイミングに注意してプログラムを作ろう！…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 08 May 2023 02:39:48 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-09-4&amp;rev=1683612840</link>
            <description>必ず、フローチャートや文章でアルゴリズムをまとめてからソースコードを書こう



１．カウンタ変数　count=1
２．count&lt;=100 の間以下を繰り返す
 　2.1 countは3の倍数かをチェック
　　　Yes:&quot;アホ&quot;と表示
　　　  No:countをそのまま表示
　2.2 countを１増やす
　2.3 　２．に戻る
３．プログラムを終了する</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 09 May 2023 06:14:00 +0000</pubDate>
        </item>
        <item>
            <title>if文の演習をします（2023年5月12日追加）</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-12-xx&amp;rev=1683871846</link>
            <description>if文の演習をします（2023年5月12日追加）

比較演算子

この辺見てね！


第１問

難易度：★☆☆☆☆



//1，条件分岐を実際に書いてみる
// ⓪ aを宣言（整数）
// ① aを読み込み（整数） std::cin　
// ② a &gt; 5 ?             if(   )～else～
//    Yes: a - 5 を表示   std::cout
//     No: a + 5 を表示   std::cout
// ③ 終了</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 12 May 2023 06:10:46 +0000</pubDate>
        </item>
        <item>
            <title>練習問題ヒント（5月16追記）</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-15-1&amp;rev=1684215475</link>
            <description>練習問題ヒント（5月16追記）

P８　練習問題


その１


	*  試験点xを入力
	*  xは６０点以上？
		*  YES：“合格”を表示
		*  NO：“不合格”を表示


 

その２


	*  x%2 == 0 ?
		*  YES: “偶数”を表示</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 16 May 2023 05:37:55 +0000</pubDate>
        </item>
        <item>
            <title>今まで授業でやったこと一覧</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-22-1&amp;rev=1685068201</link>
            <description>今まで授業でやったこと一覧


これまでに、
アルゴリズムの内容として
・３つの基本構造
　・順次構造
　・選択構造
　・繰り返し構造
・最大値、最小値
・最大値、最小値
・平均、合計

プログラミングの内容として
変数と型
・変数とメモリ
　・整数型と実数型
　　・整数型
　　　・int型
　　　・char型
　　・実数型
　　　・float型
　　　・double型

main関数とエントリポイント
変数宣言とブロック
・順次構造の書き方
・選択構造の書き方
　・if文
　・if-else文
　・if-else if-else文
　・if-else if-else if ... else文
・繰り返し構造
　・while文
　・カウント型のwhile文
　・while文と無限ループ
　・無限ループのbreak
　・for文
　・for文と無限ループ
C++の型の拡張（string型）
　・string型の使いかた
　　・string型の宣言と初期化
　　・string型の比較（==、！＝）
　　・string型の足し算
　　・string型と文字型(char）の関係
　　　・１文字…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 26 May 2023 02:30:01 +0000</pubDate>
        </item>
        <item>
            <title>レッツ文字列</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-22-3&amp;rev=1684799023</link>
            <description>レッツ文字列

すでに文字型はマスターしたと思います。

次に、文字列型を使ってみます。




	*  用語
		*  文字列リテラル
			*  C++で文字列を表すために使われる記述方法
			*  文字列リテラル
			*  簡単に言うと、ソースこーこ中に直接記述されている文字列の事</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 22 May 2023 23:43:43 +0000</pubDate>
        </item>
        <item>
            <title>１行入力</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-22-4&amp;rev=1684802424</link>
            <description>１行入力

通常、スペースを含む文字列を```cin```から入力しようとしても、スペースで勝手に入力が区切られてしまう。



#include &lt;iostream&gt;

using namespace std;

int main() {

	string str;
	cout &lt;&lt; &quot;半角スペースを含んだ１行をstrに入力:&quot;;
	cin &gt;&gt; str;
	cout &lt;&lt; str &lt;&lt; endl;
}</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 23 May 2023 00:40:24 +0000</pubDate>
        </item>
        <item>
            <title>課題を出したよ</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-22-5&amp;rev=1684741347</link>
            <description>課題を出したよ


入力として
文字列　整数１　整数２
の入力を使います。

文字列は
&quot;plus&quot;
&quot;minus&quot;
&quot;times&quot;
&quot;divide&quot;
その他に分類されます。

文字列が
&quot;plus&quot;の時は　整数１+整数２
&quot;minus&quot;の時は　整数１-整数２
&quot;times&quot;の時は　整数１×整数２
&quot;divide&quot;の時は 整数１÷整数２
の結果をかっちょよく表示し、
&quot;end&quot;の時は終了
それ以外の時は、何もせず入力処理に戻る。

というプログラムを作りなさい。
終わったら
paizaラーニングトップ＞レベルアップ問題集＞標準入力サンプル問題セット（言語選択）＞問題一覧 C++編…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 22 May 2023 07:42:27 +0000</pubDate>
        </item>
        <item>
            <title>練習問題の答え合わせ</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-23-4&amp;rev=1685591465</link>
            <description>練習問題の答え合わせ


ソースコードを４０４のPCからこぴーできなかったから、ちょいまってて


課題と配列と数当てゲーム

初めのころの資料リターンズ

下の二つの資料のところどころにある練習問題のフローチャートを書いて、プログラムを作ってみよう！</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 01 Jun 2023 03:51:05 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-29-1345&amp;rev=1685347277</link>
            <description>cout &lt;&lt; &quot;YES&quot; &lt;&lt; endl;
    else
        cout &lt;&lt; &quot;NO&quot; &lt;&lt; endl;
  


flagのはなし追加


#include &lt;iostream&gt;
using namespace std;

// 大文字または小文字のアルファベットCが与えられます。
// Cが大文字の場合はYESを、
// そうではない場合はNOを出力してください。
int main(void){
    // 自分の得意な言語で
    // Let&#039;s チャレンジ！！
    char c; //0~127のコードと文字が対応付けられている 
    cin &gt;&gt; c;
    //大文字 41~5A    16進数リテラル 接頭辞0xをつけると16進数として扱われる
    //小文字 61~7A
    if(c &gt;= 0x41  &amp;&amp; c &lt;= 0x5A)
        cout &lt;&lt; &quot;YES&quot; &lt;&lt; endl;
    else
        cout &lt;&lt; &quot;NO&quot; &lt;&lt; endl;
  
    return 0;
}

#include &lt;i…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 29 May 2023 08:01:17 +0000</pubDate>
        </item>
        <item>
            <title>多岐分岐</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-30-4&amp;rev=1685427197</link>
            <description>多岐分岐


 	//複合条件
	//論理演算
	// 論理和： OR =&gt; A または B  C++ =&gt; A || B
	// 論理積：AND =&gt; A かつ B    C++ =&gt; A &amp;&amp; B
	// 　否定：NOT =&gt; Aではない   C++ =&gt; !(A)
	// ch &gt;= 1  AND ch &lt;= 6
	//if (ch &gt;= 1  &amp;&amp; ch &lt;= 6) {
	//ORで書く　 NOT（1未満または6より大きい）
#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

// 1ch NHK総合(NHKG)
// 2ch NHK教育(NHKE)
// 3ch 東北放送(TBC)
// 4ch 仙台放送(OX)
// 5ch ミヤテレ(MMT)
// 6ch 東日本放送(KHB)
// etc. 砂嵐(ETC)

// 0  1  2  3  4  5  6
//月 火 水 木 金 土 日
//０～6を入力して、曜日を出力するプログラムを作りなさい
//0～6以外が入力されたら、そんな曜日はない。と表示
…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 30 May 2023 06:13:17 +0000</pubDate>
        </item>
        <item>
            <title>今日やったソースコードたち</title>
            <link>https://www.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:5:05-31-45&amp;rev=1685520122</link>
            <description>今日やったソースコードたち

Switch-case文で春夏秋冬



Siv3Dの基本


# include &lt;Siv3D.hpp&gt; // OpenSiv3D v0.6.10

void Main()
{
	const int WINDOW_WIDTH = 800;
	const int WINDOW_HEIGHT = 600;
	const int P_RADIUS = 20;
	int BALL_SPEED = -1;
    //	p.x = p.x + BALL_SPEED;

	// 背景の色を設定する | Set the background color
	Scene::SetBackground(Color{ 135 , 206, 250 });

	Point p{ 400,300 };//座標を表すPoint型だよ
	while (System::Update())//多分60fps
	{
		Circle{ p, P_RADIUS }.draw(Color{255, 0, 0});

		Circle{ WINDOW_WIDTH/2, 150, P_RADIUS…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 31 May 2023 08:02:02 +0000</pubDate>
        </item>
    </channel>
</rss>
