All Discussions Tagged 'C#' - Classroom 2.02024-03-29T02:34:40Zhttps://www.classroom20.com/forum/topic/listForTag?tag=C%23&feed=yes&xn_auth=noC# Μεταβλητες.tag:www.classroom20.com,2016-06-01:649749:Topic:11119242016-06-01T15:01:26.605ZNikosKoukoshttps://www.classroom20.com/profile/NikosKoukos
<p class="Standard">Οι μεταβλητές ειναι το ονομα και ο τυπος που δινουμε σε μια συγκεκριμενη τιμη πορκειμενου να αποθηκευτει στη μνημη. Αναλογα με το υπο της μεταβλητης καταλμβανει συγκεκριμενο χωρο στη μνυμη. Στη γλωσσα προγραμματισμου C# εχουμε τους παρακατω τυπουσ μεταβλητων</p>
<p class="Standard"> </p>
<p class="Standard"> </p>
<table border="0" cellspacing="0" width="497">
<tbody><tr><td width="134"><p align="left" class="TableHeading">Τυπος…</p>
</td>
<td width="363"></td>
</tr>
</tbody>
</table>
<p class="Standard">Οι μεταβλητές ειναι το ονομα και ο τυπος που δινουμε σε μια συγκεκριμενη τιμη πορκειμενου να αποθηκευτει στη μνημη. Αναλογα με το υπο της μεταβλητης καταλμβανει συγκεκριμενο χωρο στη μνυμη. Στη γλωσσα προγραμματισμου C# εχουμε τους παρακατω τυπουσ μεταβλητων</p>
<p class="Standard"> </p>
<p class="Standard"> </p>
<table border="0" cellspacing="0" width="497">
<tbody><tr><td width="134"><p class="TableHeading" align="left">Τυπος</p>
</td>
<td width="363"><p class="TableHeading" align="left">Παραδειγματα</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Integral types</p>
</td>
<td width="363"><p class="TableContents">sbyte, byte, short, ushort, int, uint, long, ulong, and char</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Floating point types</p>
</td>
<td width="363"><p class="TableContents">float and double</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Decimal types</p>
</td>
<td width="363"><p class="TableContents">decimal</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Boolean types</p>
</td>
<td width="363"><p class="TableContents">true or false values, as assigned</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Nullable types</p>
</td>
<td width="363"><p class="TableContents">Nullable data types</p>
</td>
</tr>
</tbody>
</table>
<p class="Standard"> </p>
<p class="Standard"> </p>
<p class="Standard">Ορισμος μεταβλητων</p>
<p class="Standard"> </p>
<p class="Standard"> Η διαδικασια κατα την οποια οριζουμε μια μεταβλητη και δηλωνουμε τον τυπο της.</p>
<p class="PreformattedText"><τυπος_μεταβλητης> <οvονομα>;</p>
<p class="Textbody"><br/> ακολουθουν ορισμενα παραδειγματα:</p>
<div><p class="PreformattedText">int i, j, k;</p>
<p class="PreformattedText">char c, ch;</p>
<p class="PreformattedText">float f, salary;</p>
<p class="PreformattedText">double d;</p>
</div>
<p class="Textbody"></p>
<p class="Textbody">Αρχικοποιηση μεταβλητων:</p>
<p class="Textbody">Δινουμε τις αρχικες τημες των μεταωλητων με τον εξης τροπο: ονομα_μεταβλητης = τιμη;</p>
<p class="Textbody">Μπορουμε επισης να αρχικοποιησουμε και να ορισουμε μια μεταβλητη στον ιδιο χρονο με τον εξης τροπο: <τυπος_μεταβλητης> <ονομα_μεταβλητης> = <τιμη>;</p>
<p class="Textbody">Οριμενα παραδειγματα:</p>
<p class="Textbody"> </p>
<p class="PreformattedText">int d = 3, f = 5; /* initializing d and f. */</p>
<div><p class="PreformattedText">byte z = 22; /* initializes z. */</p>
<p class="PreformattedText">double pi = 3.14159; /* declares an approximation of pi. */</p>
<p class="PreformattedText">char x = 'x'; /* the variable x has the value 'x'. */</p>
</div>
<p class="Textbody"> </p>
<p class="Textbody">Ακολουθει προγραμμα το οποιο συνηστατε να εκετελεσεται προκειμενου να εχεται μια εικονα απο το πως λειτουργουν οι μεταβλητες στη πραξη:</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">using System;</p>
<p class="PreformattedText">namespace VariableDefinition</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> class Program</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> static void Main(string[] args)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> short a;</p>
<p class="PreformattedText"> int b ;</p>
<p class="PreformattedText"> double c;</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> /* actual initialization */</p>
<p class="PreformattedText"> a = 10;</p>
<p class="PreformattedText"> b = 20;</p>
<p class="PreformattedText"> c = a + b;</p>
<p class="PreformattedText"> Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c);</p>
<p class="PreformattedText"> Console.ReadLine();</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText">}</p>
</div>
<p class="Textbody"></p>
<p class="Textbody">Εισοδος μεταβλητων απο το χρηστη:</p>
<p class="Textbody"> </p>
<p class="Textbody">Η ταξη <b>Console</b> του πεδιου <b>System</b> παρεχει τη συναρτηση <b>ReadLine</b><b>()</b> η οποια λαμβανει εισοδο απο το πληκτρολογιο του χρηστη</p>
<p class="Textbody"> </p>
<p class="Textbody">πχ</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">int num;</p>
<p class="PreformattedText">num = Convert.ToInt32(Console.ReadLine());</p>
</div>
<p>χρησημοποιησαμε τη συναρτηση <b>Convert.ToInt32() </b> για να μετατρεψουμε σε ακαιρεο την εισοδο της συναρτησης <b>Console.ReadLine()</b> καθως δεχεται ορισμα σε μορφη συμβολων (string).</p> Finishing a Game Development Book, need help...tag:www.classroom20.com,2012-11-21:649749:Topic:8936392012-11-21T18:11:08.378ZDaniel Edward Sagmillerhttps://www.classroom20.com/profile/DanielEdwardSagmiller
<p>Hello, I've just finished my first draft on a Game Development book, that I plan on using in college classes I teach. At the moment, I'm working on a syllabus/teachers guide to act as a companion book.</p>
<p></p>
<p>While I've been writting up the course plans, I'm realizing a few chapters will need to change. </p>
<p></p>
<p>So far, This is the general flow of a session:</p>
<p></p>
<p>Quiz on homework ( which is usually pre-reading a chapter and thinking about a particular question and…</p>
<p>Hello, I've just finished my first draft on a Game Development book, that I plan on using in college classes I teach. At the moment, I'm working on a syllabus/teachers guide to act as a companion book.</p>
<p></p>
<p>While I've been writting up the course plans, I'm realizing a few chapters will need to change. </p>
<p></p>
<p>So far, This is the general flow of a session:</p>
<p></p>
<p>Quiz on homework ( which is usually pre-reading a chapter and thinking about a particular question and how it applies to the world around them.)</p>
<p></p>
<p>Open Discussion on key a key topic of the session, </p>
<p></p>
<p>Breaking down the key topic into a few other smaller parts, </p>
<p> - Explaining an over view of them, and starting a class discussion on each.</p>
<p> - Usually breaking into teams to discuss opinions on the topics, and how it relates to their individual projects.</p>
<p></p>
<p>Working on the portion of their final project that relates to today (Game design is one segment of the book, so the final project on that is to hand in a complete game design, and each session focuses on a key part of it.)</p>
<p></p>
<p>*********2 questions?????????</p>
<p>1) Are there any changes or additions you might suggest for the typical flow (some sessions break out of this, it depends on the need of the session)</p>
<p></p>
<p>2) If anyone is interested in helping me co-author the Course Guide, please contact me. This is the first time I'm creating a full syllabus/course guide for teachers new to the book. </p>
<p></p>
<p>*********Background************</p>
<p>I've been teaching game development classes at various colleges, businesses and also my own school for almost a decade. During that time, I have not found a book that covers similar material, or provides as much coverage as I do. Over time, I had written short supporting books (10-30 pages) for the classes. A few months ago, I decided to turn them into an actual book. I've finished the book, which is broken into 5 key segments totaling around 300 pages:</p>
<p>1) Game Design - Focuses on designing a game that can be built by an indie group, with a design document people will actually read and use. </p>
<p></p>
<p>2) Team Management - Managing a freelance/indie team is tough, considering people are seldom paid, and you have to keep them interested. It discusses roles, and role-tasks, and identifying weak areas. It also talks about keeping the work fun, team engaged, and working in segments that can be easily done.</p>
<p></p>
<p>3a) C# Console Programming - to introduce C#, a common programming language, it will work with the console for decisions, variables, comments, etc...</p>
<p></p>
<p>3b) C# UI Programming - to introduce event based programming and the use of Ui Objects, such as lists, buttons and forms.</p>
<p></p>
<p>3c) C# OOP - to introduce more complex topics of Programming, and the most flexible/useful portions.</p>
<p></p>
<p>4) Making a Game - The students develop a complete game, with enemies, bosses, levels, points, plot, AI, Physics, Menus, etc... (The game is available for download online) This teaches how to use XNA as the foundation to a game engine in C#, and also teaches about Architecture and Design Patterns. It is presented using the Agile methodology as a foundation.</p>
<p></p>
<p>5) Release - talks about testing, Alpha/Beta and Release, Supporting it, Marketing the game, and also finding investors and how to work with them.</p>
<p></p>
<p>The second (much smaller) book, is to give the teacher additional things to focus on, and help them facilitate discussion on the materials. Ultimately, the students teach them selves a great deal on this, and the teacher will help guide it.</p>