<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://coderwiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dylan</id>
	<title>Coderwiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://coderwiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dylan"/>
	<link rel="alternate" type="text/html" href="http://coderwiki.org/Special:Contributions/Dylan"/>
	<updated>2026-05-19T05:31:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://coderwiki.org/index.php?title=Main_Page&amp;diff=157</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Main_Page&amp;diff=157"/>
		<updated>2025-10-03T13:37:00Z</updated>

		<summary type="html">&lt;p&gt;Dylan: emphasise new general study focus&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Welcome to Coderwiki! =&lt;br /&gt;
Coderwiki is a free and community-run wiki for any sort of study resources from concept explanations to references and even full examples for various different topics.&lt;br /&gt;
&lt;br /&gt;
Coderwiki allows any sort of educational content. Content should be written in a concise and easy-to-understand way - we don&#039;t need every detail about a topic, we&#039;re not trying to be Wikipedia.&lt;br /&gt;
&lt;br /&gt;
== Why is it called Coderwiki? ==&lt;br /&gt;
The wiki started off as a place just for programming content, but we&#039;ve since diversified into many different areas of study! Coderwiki now is a place to share any type of study resources.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re a community-led site, meaning we rely on people like you contributing to make the wiki better! Please consider editing pages or creating new ones if you think you can improve Coderwiki :)&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Code_block&amp;diff=156</id>
		<title>Code block</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Code_block&amp;diff=156"/>
		<updated>2025-08-21T13:53:26Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, uses, evaluation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;code block&#039;&#039;&#039; is a section of [[source code]] that is &#039;&#039;isolated&#039;&#039; in some way from other parts of the [[program]].&lt;br /&gt;
&lt;br /&gt;
This often means that [[Variable|variables]] that are [[Variable declaration|declared]] &#039;&#039;inside&#039;&#039; the code block cannot be referenced &#039;&#039;outside&#039;&#039; the code block. But code blocks can have other functions.&lt;br /&gt;
&lt;br /&gt;
== Uses of code blocks ==&lt;br /&gt;
&lt;br /&gt;
* Declaring the body of a [[subroutine]]&lt;br /&gt;
* Declaring the body of an [[if statement]], [[switch statement]] or other [[Condition|conditional statement]]&lt;br /&gt;
* Declaring the body of a [[while loop]], [[for loop]] or other [[Iteration|iterative statement]]&lt;br /&gt;
&lt;br /&gt;
== Evaluation ==&lt;br /&gt;
In some [[Programming language|languages]] such as [[Rust]], code blocks have another use: to [[Evaluation|evaluate]] multiple [[Statement|statements]] down to a single [[value]].&lt;br /&gt;
&lt;br /&gt;
Usually, the last [[statement]] in the &#039;&#039;&#039;code block&#039;&#039;&#039; is taken to be the [[value]] of the code block itself. Code blocks do not always [[Evaluation|evaluate]] to a [[value]] though.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Value&amp;diff=155</id>
		<title>Value</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Value&amp;diff=155"/>
		<updated>2025-08-20T21:09:05Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, attributes, evaluation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;value&#039;&#039;&#039; is a fundamental concept representing a specific piece of [[Data (computing)|data]] that can often be [[Assignment|manipulated]] by a [[program]]. It is the actual data itself, as opposed to the [[Variable (computer science)|variable]], which is a named container or reference that &#039;&#039;holds&#039;&#039; a &#039;&#039;&#039;value&#039;&#039;&#039;. Values are the most basic units of information processed by a [[program]].&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
Values usually have:&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;[[Data type|type]]&#039;&#039;&#039; (e.g., [[integer]], [[string]], [[boolean]], [[Object|other object]])&lt;br /&gt;
* Some &#039;&#039;&#039;data content&#039;&#039;&#039; (the actual [[Bit|bits]] representing the data, according to its [[Data type|type]])&lt;br /&gt;
&lt;br /&gt;
Values can be [[Mutability|mutable]], meaning their data can be changed after [[assignment]], or [[Mutability|immutable]], meaning their data &#039;&#039;&#039;cannot&#039;&#039;&#039; be changed after [[assignment]].&lt;br /&gt;
&lt;br /&gt;
== Evaluation ==&lt;br /&gt;
In an [[Expression (computer science)|expression]], variables and function calls are evaluated to produce a &#039;&#039;&#039;value&#039;&#039;&#039; before the operation is performed:&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a = 10;    // evaluated to the value 10 then assigned to &#039;a&#039;&lt;br /&gt;
int b = 20;    // evaluated to the value 20 then assigned to &#039;a&#039;&lt;br /&gt;
int c = a + b; // evaluated to the value 30 THEN assigned to &#039;c&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=154</id>
		<title>C Sharp float</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=154"/>
		<updated>2025-08-19T13:23:40Z</updated>

		<summary type="html">&lt;p&gt;Dylan: replace &amp;#039;d&amp;#039; passed to float.Parse with &amp;#039;c&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;float&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative &#039;&#039;&#039;decimal&#039;&#039;&#039; numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Floating point]] for generic information about what floats can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;float&#039;&#039;&#039; in C# is represented by 4 [[Byte|bytes]], or 32 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
They are usually [[Floating point accuracy|accurate]] up to around 7 digits.&lt;br /&gt;
&lt;br /&gt;
If you need more [[precision]] or larger/smaller numbers, you can instead use the [[C Sharp double|double]] [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
float a;&lt;br /&gt;
float b = 539.72;&lt;br /&gt;
float c = (float)781; // 781.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Casting ==&lt;br /&gt;
To [[Casting|cast]] to a &#039;&#039;&#039;float&#039;&#039;&#039;, you can use the [[C Sharp casting|casting operator]] &amp;lt;code&amp;gt;(float)&amp;lt;/code&amp;gt; for casting from numerical values, or the [[C Sharp float.Parse|float.Parse]] [[function]] for casting a [[String]] (see [[C Sharp string]]) to a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a = 70;&lt;br /&gt;
float b = (float)a; // 70.0&lt;br /&gt;
string c = &amp;quot;56.9&amp;quot;;&lt;br /&gt;
float d = float.Parse(c); // 56.9&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This is different to casting to a [[double]], which uses the &amp;lt;code&amp;gt;(double)&amp;lt;/code&amp;gt; operator or the [[C Sharp double.Parse|double.Parse]] function.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=153</id>
		<title>C Sharp float</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=153"/>
		<updated>2025-08-19T13:22:13Z</updated>

		<summary type="html">&lt;p&gt;Dylan: replace &amp;#039;int&amp;#039; with &amp;#039;float&amp;#039; in casting section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;float&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative &#039;&#039;&#039;decimal&#039;&#039;&#039; numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Floating point]] for generic information about what floats can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;float&#039;&#039;&#039; in C# is represented by 4 [[Byte|bytes]], or 32 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
They are usually [[Floating point accuracy|accurate]] up to around 7 digits.&lt;br /&gt;
&lt;br /&gt;
If you need more [[precision]] or larger/smaller numbers, you can instead use the [[C Sharp double|double]] [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
float a;&lt;br /&gt;
float b = 539.72;&lt;br /&gt;
float c = (float)781; // 781.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Casting ==&lt;br /&gt;
To [[Casting|cast]] to a &#039;&#039;&#039;float&#039;&#039;&#039;, you can use the [[C Sharp casting|casting operator]] &amp;lt;code&amp;gt;(float)&amp;lt;/code&amp;gt; for casting from numerical values, or the [[C Sharp float.Parse|float.Parse]] [[function]] for casting a [[String]] (see [[C Sharp string]]) to a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a = 70;&lt;br /&gt;
float b = (float)a; // 70.0&lt;br /&gt;
string c = &amp;quot;56.9&amp;quot;;&lt;br /&gt;
float d = float.Parse(d); // 56.9&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This is different to casting to a [[double]], which uses the &amp;lt;code&amp;gt;(double)&amp;lt;/code&amp;gt; operator or the [[C Sharp double.Parse|double.Parse]] function.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=152</id>
		<title>C Sharp float</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=152"/>
		<updated>2025-08-19T13:21:21Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: casting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;float&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative &#039;&#039;&#039;decimal&#039;&#039;&#039; numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Floating point]] for generic information about what floats can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;float&#039;&#039;&#039; in C# is represented by 4 [[Byte|bytes]], or 32 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
They are usually [[Floating point accuracy|accurate]] up to around 7 digits.&lt;br /&gt;
&lt;br /&gt;
If you need more [[precision]] or larger/smaller numbers, you can instead use the [[C Sharp double|double]] [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
float a;&lt;br /&gt;
float b = 539.72;&lt;br /&gt;
float c = (float)781; // 781.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Casting ==&lt;br /&gt;
To [[Casting|cast]] to an &#039;&#039;&#039;int&#039;&#039;&#039;, you can use the [[C Sharp casting|casting operator]] &amp;lt;code&amp;gt;(float)&amp;lt;/code&amp;gt; for casting from numerical values, or the [[C Sharp float.Parse|float.Parse]] [[function]] for casting a [[String]] (see [[C Sharp string]]) to a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a = 70;&lt;br /&gt;
float b = (float)a; // 70.0&lt;br /&gt;
string c = &amp;quot;56.9&amp;quot;;&lt;br /&gt;
float d = float.Parse(d); // 56.9&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This is different to casting to a [[double]], which uses the &amp;lt;code&amp;gt;(double)&amp;lt;/code&amp;gt; operator or the [[C Sharp double.Parse|double.Parse]] function.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=151</id>
		<title>C Sharp int</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=151"/>
		<updated>2025-08-19T13:10:59Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: casting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;int&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative whole numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Integer]] for generic information about what integers can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;long&#039;&#039;&#039; in C# is represented by &#039;&#039;&#039;4&#039;&#039;&#039; [[Byte|bytes]], or &#039;&#039;&#039;32&#039;&#039;&#039; [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
This means it can store integral values from &amp;lt;code&amp;gt;-2,147,483,648&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2,147,483,647&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For [[Integer|integers]] that don&#039;t fit this range, you can use the [[C Sharp long]] data type instead.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a;&lt;br /&gt;
int b = 74;&lt;br /&gt;
int c = (int)15.2; // 15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Casting ==&lt;br /&gt;
To [[Casting|cast]] to an &#039;&#039;&#039;int&#039;&#039;&#039;, you can use the [[C Sharp casting|casting operator]] &amp;lt;code&amp;gt;(int)&amp;lt;/code&amp;gt; or the [[C Sharp Convert.ToInt32|Convert.ToInt32]] [[function]]:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
char a = &#039;A&#039;;&lt;br /&gt;
int b = (int)a; // 65&lt;br /&gt;
int c = Convert.ToChar(a); // 65&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This is different to casting to a [[C Sharp long|long]], which uses the &amp;lt;code&amp;gt;(long)&amp;lt;/code&amp;gt; operator or the [[C Sharp Convert.ToInt64|Convert.ToInt64]] function.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_char&amp;diff=150</id>
		<title>C Sharp char</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_char&amp;diff=150"/>
		<updated>2025-08-19T13:05:54Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: casting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;char&#039;&#039;&#039; [[data type]] in [[C Sharp]] is used to store a &#039;&#039;&#039;single character&#039;&#039;&#039; [[value]], usually in a [[variable]].&lt;br /&gt;
&lt;br /&gt;
It is the base unit for the [[string]] data type (see [[C Sharp string]]).&lt;br /&gt;
&lt;br /&gt;
See [[Char]] for general information about the uses and [[memory layout]] of a character [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
[[Value|Values]] of type &amp;lt;code&amp;gt;char&amp;lt;/code&amp;gt; take up &#039;&#039;&#039;2&#039;&#039;&#039; [[Byte|bytes]] in [[memory]] in C#.&lt;br /&gt;
&lt;br /&gt;
This means they can store &amp;lt;code&amp;gt;65536&amp;lt;/code&amp;gt; different character [[Value|values]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
char a = &#039;a&#039;;&lt;br /&gt;
char b = &#039;&amp;amp;&#039;;&lt;br /&gt;
string c = &amp;quot;hello world&amp;quot;;&lt;br /&gt;
char d = c[4]; // &#039;o&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Casting ==&lt;br /&gt;
To [[Casting|cast]] to a char, you can use the [[C Sharp casting|casting operator]] or the [[C Sharp Convert.ToChar|Convert.ToChar]] method:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
sbyte a = 65;&lt;br /&gt;
char b = (char)a; // &#039;A&#039;&lt;br /&gt;
char c = Convert.ToChar(a); // &#039;A&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_char&amp;diff=149</id>
		<title>C Sharp char</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_char&amp;diff=149"/>
		<updated>2025-08-19T13:01:33Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, size, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;char&#039;&#039;&#039; [[data type]] in [[C Sharp]] is used to store a &#039;&#039;&#039;single character&#039;&#039;&#039; [[value]], usually in a [[variable]].&lt;br /&gt;
&lt;br /&gt;
It is the base unit for the [[string]] data type (see [[C Sharp string]]).&lt;br /&gt;
&lt;br /&gt;
See [[Char]] for general information about the uses and [[memory layout]] of a character [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
[[Value|Values]] of type &amp;lt;code&amp;gt;char&amp;lt;/code&amp;gt; take up &#039;&#039;&#039;2&#039;&#039;&#039; [[Byte|bytes]] in [[memory]] in C#.&lt;br /&gt;
&lt;br /&gt;
This means they can store &amp;lt;code&amp;gt;65536&amp;lt;/code&amp;gt; different character [[Value|values]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
char a = &#039;a&#039;;&lt;br /&gt;
char b = &#039;&amp;amp;&#039;;&lt;br /&gt;
string c = &amp;quot;hello world&amp;quot;;&lt;br /&gt;
char d = c[4]; // &#039;o&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_bool&amp;diff=148</id>
		<title>C Sharp bool</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_bool&amp;diff=148"/>
		<updated>2025-08-19T12:52:24Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, size, true and false, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;bool&#039;&#039;&#039; [[class]] in [[C Sharp|C#]] is a [[data type]] which can store one of two [[Value|values]]:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Booleans are especially useful when working with [[Condition|conditions]].&lt;br /&gt;
&lt;br /&gt;
See [[Boolean]] for general information about the uses and representation of boolean data types.&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
While a boolean &#039;&#039;could&#039;&#039; technically store a bool as a single [[bit]], this wouldn&#039;t necessarily be optimal for [[memory layout]].&lt;br /&gt;
&lt;br /&gt;
For this reason, booleans in C# are stored as 1 [[byte]] in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Keywords: true and false ==&lt;br /&gt;
C# gives us two [[Keyword|keywords]] for the boolean values &#039;&#039;&#039;true&#039;&#039;&#039; and &#039;&#039;&#039;false&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The keywords are, logically, [[C Sharp true|&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;]] and [[C Sharp false|&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;]] respectively.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
bool a = true;&lt;br /&gt;
bool b = false;&lt;br /&gt;
bool c = Convert.ToBoolean(1); // true&lt;br /&gt;
bool d = Convert.ToBoolean(0); // false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_double&amp;diff=147</id>
		<title>C Sharp double</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_double&amp;diff=147"/>
		<updated>2025-08-19T08:34:18Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, size, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;double&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative &#039;&#039;&#039;decimal&#039;&#039;&#039; numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Floating point]] for generic information about what doubles can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;double&#039;&#039;&#039; in C# is represented by 8 [[Byte|bytes]], or 64 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
They are usually [[Floating point accuracy|accurate]] up to around 15 digits.&lt;br /&gt;
&lt;br /&gt;
If you need &#039;&#039;&#039;less&#039;&#039;&#039; [[precision]] or don&#039;t need very large/small numbers, you can instead use the [[C Sharp float|float]] [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
double a;&lt;br /&gt;
double b = 539.72;&lt;br /&gt;
double c = (double)781; // 781.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=146</id>
		<title>C Sharp float</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_float&amp;diff=146"/>
		<updated>2025-08-19T08:32:29Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, size, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;float&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative &#039;&#039;&#039;decimal&#039;&#039;&#039; numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Floating point]] for generic information about what floats can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;float&#039;&#039;&#039; in C# is represented by 4 [[Byte|bytes]], or 32 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
They are usually [[Floating point accuracy|accurate]] up to around 7 digits.&lt;br /&gt;
&lt;br /&gt;
If you need more [[precision]] or larger/smaller numbers, you can instead use the [[C Sharp double|double]] [[data type]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
float a;&lt;br /&gt;
float b = 539.72;&lt;br /&gt;
float c = (float)781; // 781.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=145</id>
		<title>C Sharp int</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=145"/>
		<updated>2025-08-19T08:29:01Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;int&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative whole numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Integer]] for generic information about what integers can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;long&#039;&#039;&#039; in C# is represented by &#039;&#039;&#039;4&#039;&#039;&#039; [[Byte|bytes]], or &#039;&#039;&#039;32&#039;&#039;&#039; [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
This means it can store integral values from &amp;lt;code&amp;gt;-2,147,483,648&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2,147,483,647&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For [[Integer|integers]] that don&#039;t fit this range, you can use the [[C Sharp long]] data type instead.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a;&lt;br /&gt;
int b = 74;&lt;br /&gt;
int c = (int)15.2; // 15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_long&amp;diff=144</id>
		<title>C Sharp long</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_long&amp;diff=144"/>
		<updated>2025-08-19T08:28:51Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, size, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The &#039;&#039;&#039;long&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative whole numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Integer]] for generic information about what integers and longs can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
A &#039;&#039;&#039;long&#039;&#039;&#039; in C# is represented by 8 [[Byte|bytes]], or 64 [[Bit|bits]].&lt;br /&gt;
&lt;br /&gt;
This means it can store integral values from &amp;lt;code&amp;gt;-9,223,372,036,854,775,808&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;9,223,372,036,854,775,807&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For less extreme integers (anything between &amp;lt;code&amp;gt;-2,147,483,648&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2,147,483,647&amp;lt;/code&amp;gt;), you can use the [[C Sharp int]] data type instead, which uses less space in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
long a;&lt;br /&gt;
long b = 74;&lt;br /&gt;
long c = (long)15.2; // 15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=143</id>
		<title>C Sharp int</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_int&amp;diff=143"/>
		<updated>2025-08-18T18:03:09Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;int&#039;&#039;&#039; [[class]] in [[C Sharp]] is a [[data type]] which can store positive and negative whole numbers in [[Variable|variables]].&lt;br /&gt;
&lt;br /&gt;
See [[Integer]] for generic information about what integers can represent and how they are represented in [[memory]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int a;&lt;br /&gt;
int b = 74;&lt;br /&gt;
int c = (int)15.2; // 15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_string.IndexOf&amp;diff=141</id>
		<title>C Sharp string.IndexOf</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_string.IndexOf&amp;diff=141"/>
		<updated>2025-08-15T13:05:28Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[C Sharp]] implements the &amp;lt;code&amp;gt;IndexOf&amp;lt;/code&amp;gt; method on the [[C Sharp string|string]] type.&lt;br /&gt;
&lt;br /&gt;
See [[String position]] for general information on the usage of this method.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
string haystack = &amp;quot;Hello world, C# is a programming language&amp;quot;;&lt;br /&gt;
string needle = &amp;quot;C#&amp;quot;;&lt;br /&gt;
int position = haystack.IndexOf(needle);&lt;br /&gt;
Console.WriteLine(position);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Output:&lt;br /&gt;
 13&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=String_position&amp;diff=140</id>
		<title>String position</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=String_position&amp;diff=140"/>
		<updated>2025-08-15T12:25:31Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, specific programming language&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most [[Programming language|programming languages]] implement a &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;indexOf&amp;lt;/code&amp;gt; [[method]] on [[String|strings]].&lt;br /&gt;
&lt;br /&gt;
This method will return the [[Collection index|index]] of the first [[Char|character]] of the [[substring]] in the main [[string]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following [[Java]] code shows the &amp;lt;code&amp;gt;indexOf&amp;lt;/code&amp;gt; [[method]]:&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
String haystack = &amp;quot;Hello world, Java is a programming language&amp;quot;;&lt;br /&gt;
String needle = &amp;quot;Java&amp;quot;;&lt;br /&gt;
int position = haystack.indexOf(needle);&lt;br /&gt;
System.out.println(position); // 13&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Specific programming languages ==&lt;br /&gt;
&lt;br /&gt;
* [[C Sharp string.IndexOf]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Collection_element&amp;diff=139</id>
		<title>Collection element</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Collection_element&amp;diff=139"/>
		<updated>2025-08-15T11:55:35Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;element&#039;&#039;&#039; of a [[collection]] is an &#039;&#039;item&#039;&#039; of the collection.&lt;br /&gt;
&lt;br /&gt;
== Element index ==&lt;br /&gt;
&lt;br /&gt;
Every element in a collection has an [[Collection index|index]] based on where it is in the collection.&lt;br /&gt;
&lt;br /&gt;
This index is not always an [[integer]] and does not always determine where it is stored in [[memory]]. In a [[hashmap]] for example, elements are given a [[hashmap key]], which could be any hashable type, for example, a [[string]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Interpreted_language&amp;diff=138</id>
		<title>Interpreted language</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Interpreted_language&amp;diff=138"/>
		<updated>2025-08-15T11:48:32Z</updated>

		<summary type="html">&lt;p&gt;Dylan: redirect to Interpreter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Interpreter]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Translator&amp;diff=137</id>
		<title>Translator</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Translator&amp;diff=137"/>
		<updated>2025-08-15T11:47:28Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A translator is a program which takes [[source code]] and converts it into [[machine code]] which the [[Central processing unit|CPU]] can understand.&lt;br /&gt;
&lt;br /&gt;
== Types of translator ==&lt;br /&gt;
&lt;br /&gt;
* [[Compiler]]&lt;br /&gt;
* [[Interpreter]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Source_code&amp;diff=136</id>
		<title>Source code</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Source_code&amp;diff=136"/>
		<updated>2025-08-15T11:45:26Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, translators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Source code is the human-readable version of the [[program]].&lt;br /&gt;
&lt;br /&gt;
It is written in a [[programming language]].&lt;br /&gt;
&lt;br /&gt;
[[Central processing unit|CPUs]] only understand [[machine code]], not source code. This means we need a [[translator]] to convert this source code into [[machine code]] which the computer understands.&lt;br /&gt;
&lt;br /&gt;
== Translators ==&lt;br /&gt;
The two main types of translators for source code are:&lt;br /&gt;
&lt;br /&gt;
* [[Compiler]]&lt;br /&gt;
* [[Interpreter]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Collection&amp;diff=135</id>
		<title>Collection</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Collection&amp;diff=135"/>
		<updated>2025-08-15T11:41:11Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, common collections, usage in this wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A collection is a general term for any sort of [[iterable]] list which can store multiple [[Collection element|elements]].&lt;br /&gt;
&lt;br /&gt;
== Common collections ==&lt;br /&gt;
&lt;br /&gt;
* [[Array]]&lt;br /&gt;
* [[List]]&lt;br /&gt;
* [[Hashmap]] / [[dictionary]]&lt;br /&gt;
&lt;br /&gt;
== Usage in this wiki ==&lt;br /&gt;
&#039;Collection&#039; is used throughout this wiki to refer to any sort of [[array]] or [[list]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=String_length&amp;diff=134</id>
		<title>String length</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=String_length&amp;diff=134"/>
		<updated>2025-08-15T11:21:32Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: C Sharp language-specific guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most [[Programming language|programming languages]] (with the notable exception of [[C]]) have a way to check the number of [[Collection element|elements]] in a [[collection]].&lt;br /&gt;
&lt;br /&gt;
As [[String|strings]] are just [[Collection|collections]], this [[method]] applies to [[String|strings]] too.&lt;br /&gt;
&lt;br /&gt;
== Null termination ==&lt;br /&gt;
In many languages, [[String|strings]] are [[Null termination|null terminated]]. This means that if you have a 5-character string, it will actually be a [[collection]] of 6 [[Collection element|elements]] (as it includes the &amp;lt;code&amp;gt;\0&amp;lt;/code&amp;gt; null-terminator).&lt;br /&gt;
&lt;br /&gt;
When checking a string&#039;s length in most programming languages, this null terminator is ignored, so the length will come out as 5 in the example above.&lt;br /&gt;
&lt;br /&gt;
== Checking a string&#039;s length ==&lt;br /&gt;
In most programming languages, there is either a [[function]], [[method]] or [[field]] which returns the length of the string.&lt;br /&gt;
&lt;br /&gt;
Guides for specific programming languages:&lt;br /&gt;
&lt;br /&gt;
* [[C Sharp string.Length]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_string.Length&amp;diff=133</id>
		<title>C Sharp string.Length</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_string.Length&amp;diff=133"/>
		<updated>2025-08-15T11:15:20Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add example/output section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[C Sharp]], any [[C Sharp string|string]] has the &amp;lt;code&amp;gt;Length&amp;lt;/code&amp;gt; [[property]].&lt;br /&gt;
&lt;br /&gt;
You can access it by calling &amp;lt;code&amp;gt;.Length&amp;lt;/code&amp;gt; on any [[C Sharp string|string]] object.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
string name = &amp;quot;Bob&amp;quot;;&lt;br /&gt;
int length = name.Length;&lt;br /&gt;
Console.WriteLine(name);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Output:&lt;br /&gt;
 3&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=C_Sharp_string.Length&amp;diff=132</id>
		<title>C Sharp string.Length</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=C_Sharp_string.Length&amp;diff=132"/>
		<updated>2025-08-15T11:14:57Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[C Sharp]], any [[C Sharp string|string]] has the &amp;lt;code&amp;gt;Length&amp;lt;/code&amp;gt; [[property]].&lt;br /&gt;
&lt;br /&gt;
You can access it by calling &amp;lt;code&amp;gt;.Length&amp;lt;/code&amp;gt; on any [[C Sharp string|string]] object.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
string name = &amp;quot;Bob&amp;quot;;&lt;br /&gt;
int length = name.Length;&lt;br /&gt;
Console.WriteLine(name);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Do_while_loop&amp;diff=131</id>
		<title>Do while loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Do_while_loop&amp;diff=131"/>
		<updated>2025-08-15T11:13:59Z</updated>

		<summary type="html">&lt;p&gt;Dylan: replace &amp;#039;String&amp;#039; with &amp;#039;string&amp;#039; in code example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;do while loop&#039;&#039;&#039; will repeat ([[Iteration|iterate]]) a [[code block]] while a [[condition]] is [[Boolean|true]], &#039;&#039;&#039;but will first check the condition &#039;&#039;after&#039;&#039; first running the codeblock&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This type of loop is known as [[indefinite iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following [[C Sharp]] code will loop until the [[User input|user enters]] &#039;stop&#039;, &#039;&#039;&#039;but the [[condition]] is only checked after the code block has first executed&#039;&#039;&#039;. This means that, even though it seems like the loop should stop right away as the [[condition]] is [[Boolean|false]], it still runs once (then the [[value]] is [[Assignment|overwritten]] anyway):&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
string input = &amp;quot;stop&amp;quot;;&lt;br /&gt;
do {&lt;br /&gt;
    input = Console.ReadLine();&lt;br /&gt;
} while (input != &amp;quot;stop&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== While loop ==&lt;br /&gt;
If you &#039;&#039;&#039;do not&#039;&#039;&#039; want the code to run at least once before checking the [[condition]] but instead want to check the condition &#039;&#039;&#039;first&#039;&#039;&#039;, you can use a [[while loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[While loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=While_loop&amp;diff=130</id>
		<title>While loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=While_loop&amp;diff=130"/>
		<updated>2025-08-15T11:13:31Z</updated>

		<summary type="html">&lt;p&gt;Dylan: replace &amp;#039;String&amp;#039; with &amp;#039;string&amp;#039; in code example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;while loop&#039;&#039;&#039; will repeat ([[Iteration|iterate]]) a [[code block]] while a [[condition]] is [[Boolean|true]].&lt;br /&gt;
&lt;br /&gt;
This type of loop is known as [[indefinite iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following [[C Sharp]] code will loop until the [[User input|user enters]] &#039;stop&#039;:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
string input;&lt;br /&gt;
while (input != &amp;quot;stop&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
    input = Console.ReadLine();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do while loop ==&lt;br /&gt;
If you want the code to run at least once before checking the [[condition]], you can use a [[do while loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[Do while loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=String_length&amp;diff=129</id>
		<title>String length</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=String_length&amp;diff=129"/>
		<updated>2025-08-15T11:08:50Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, null termination, checking a string&amp;#039;s length&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most [[Programming language|programming languages]] (with the notable exception of [[C]]) have a way to check the number of [[Collection element|elements]] in a [[collection]].&lt;br /&gt;
&lt;br /&gt;
As [[String|strings]] are just [[Collection|collections]], this [[method]] applies to [[String|strings]] too.&lt;br /&gt;
&lt;br /&gt;
== Null termination ==&lt;br /&gt;
In many languages, [[String|strings]] are [[Null termination|null terminated]]. This means that if you have a 5-character string, it will actually be a [[collection]] of 6 [[Collection element|elements]] (as it includes the &amp;lt;code&amp;gt;\0&amp;lt;/code&amp;gt; null-terminator).&lt;br /&gt;
&lt;br /&gt;
When checking a string&#039;s length in most programming languages, this null terminator is ignored, so the length will come out as 5 in the example above.&lt;br /&gt;
&lt;br /&gt;
== Checking a string&#039;s length ==&lt;br /&gt;
In most programming languages, there is either a [[function]], [[method]] or [[field]] which returns the length of the string.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Or_operator&amp;diff=128</id>
		<title>Or operator</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Or_operator&amp;diff=128"/>
		<updated>2025-08-15T10:46:12Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, syntax, examples where true, examples where false&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The &#039;&#039;&#039;or&#039;&#039;&#039; [[operator]] is a [[boolean operator]] which will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &#039;&#039;&#039;either of&#039;&#039;&#039; the two [[boolean]] values either side of it are &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
In many languages, the &#039;&#039;&#039;and&#039;&#039;&#039; [[operator]] uses the &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt; symbols.&lt;br /&gt;
&lt;br /&gt;
In some other languages, a [[keyword]] is used instead: in [[Python]], for example, this [[keyword]] is or.&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;o&amp;lt;/u&amp;gt;&amp;lt;u&amp;gt;r&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;true&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
true || true&lt;br /&gt;
true || false&lt;br /&gt;
4 &amp;lt; 7 || 2 &amp;gt; 9&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;and&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;false&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;false || false&lt;br /&gt;
16 &amp;lt; 10 || 5 == 8&lt;br /&gt;
false || 9 != 9&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Not_operator&amp;diff=127</id>
		<title>Not operator</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Not_operator&amp;diff=127"/>
		<updated>2025-08-15T10:44:21Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, syntax, examples where true, examples where false&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;and&#039;&#039;&#039; [[operator]] is a [[boolean operator]] which will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the  [[boolean]] value to the right of it is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
In many languages, the &#039;&#039;&#039;not&#039;&#039;&#039; [[operator]] uses the &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt; symbol.&lt;br /&gt;
&lt;br /&gt;
In some other languages, a [[keyword]] is used instead: in [[Python]], for example, this [[keyword]] is not.&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;n&amp;lt;/u&amp;gt;&amp;lt;u&amp;gt;ot&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;true&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
!false&lt;br /&gt;
!(4 &amp;lt; 6)&lt;br /&gt;
!(7 == 8)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;n&amp;lt;/u&amp;gt;&amp;lt;u&amp;gt;ot&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;false&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;!true&lt;br /&gt;
!(5 == 5)&lt;br /&gt;
!(8 &amp;lt; 10)&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Condition&amp;diff=126</id>
		<title>Condition</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Condition&amp;diff=126"/>
		<updated>2025-08-15T10:35:46Z</updated>

		<summary type="html">&lt;p&gt;Dylan: replace incorrect link to Conditional operator with Comparison operator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;condition&#039;&#039;&#039; is a statement that evaluates to a [[boolean]] [[value]].&lt;br /&gt;
&lt;br /&gt;
They are often used in [[selection]] statements (such as [[If statement|if statements]]) to [[Code branch|branch code]] (do different things based on [[User input|input]]).&lt;br /&gt;
&lt;br /&gt;
== Conditional operators ==&lt;br /&gt;
Conditional [[Operator|operators]] are the [[syntax]] used to evaluate a statement to a [[boolean]] [[value]].&lt;br /&gt;
&lt;br /&gt;
See: [[Comparison operator]].&lt;br /&gt;
&lt;br /&gt;
== Conditional statements ==&lt;br /&gt;
Conditional &#039;&#039;&#039;statements&#039;&#039;&#039; are [[selection]]: they allow us to [[Code branch|branch code]] based on the result of a &#039;&#039;&#039;condition&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The main conditional statement is the [[if statement]], but there are other types of [[selection]], such as the [[switch statement]] and [[match statement]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=And_operator&amp;diff=125</id>
		<title>And operator</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=And_operator&amp;diff=125"/>
		<updated>2025-08-15T10:34:21Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, syntax, examples where true, examples where false&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;and&#039;&#039;&#039; [[operator]] is a [[boolean operator]] which will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the two [[boolean]] values either side of it are both &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
In many languages, the &#039;&#039;&#039;and&#039;&#039;&#039; [[operator]] uses the &amp;lt;code&amp;gt;&amp;amp;&amp;amp;&amp;lt;/code&amp;gt; symbols.&lt;br /&gt;
&lt;br /&gt;
In some other languages, a [[keyword]] is used instead: in [[Python]], for example, this [[keyword]] is &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;and&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;true&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
true &amp;amp;&amp;amp; true&lt;br /&gt;
4 &amp;lt; 7 &amp;amp;&amp;amp; 9 &amp;gt; 2&lt;br /&gt;
(!false) &amp;amp;&amp;amp; true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples where &amp;lt;u&amp;gt;and&amp;lt;/u&amp;gt; returns &amp;lt;u&amp;gt;false&amp;lt;/u&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;false &amp;amp;&amp;amp; false&lt;br /&gt;
false &amp;amp;&amp;amp; true&lt;br /&gt;
6 &amp;lt; 10 &amp;amp;&amp;amp; 5 == 8&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Identifier_name_rules&amp;diff=124</id>
		<title>Identifier name rules</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Identifier_name_rules&amp;diff=124"/>
		<updated>2025-08-15T10:29:13Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: identifier name must not match keyword rule&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Different [[Programming language|programming languages]] have different rules on how [[Identifier|identifiers]] can be named.&lt;br /&gt;
&lt;br /&gt;
== General rules ==&lt;br /&gt;
In most programming languages, you must follow these [[identifier]] naming rules:&lt;br /&gt;
&lt;br /&gt;
* The identifier cannot contain spaces&lt;br /&gt;
* The identifier can contain only numbers, letters and underscores&lt;br /&gt;
* The identifier must not start with a number&lt;br /&gt;
* The identifier name must not be the same as a language [[keyword]]&lt;br /&gt;
&lt;br /&gt;
== Identifier naming conventions ==&lt;br /&gt;
While not &#039;&#039;rules&#039;&#039;, most programming languages have conventions you should follow.&lt;br /&gt;
&lt;br /&gt;
There are also good practices to name your [[identifier]] as clearly as possible.&lt;br /&gt;
&lt;br /&gt;
See: [[Identifier naming conventions]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Identifier_name_rules&amp;diff=123</id>
		<title>Identifier name rules</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Identifier_name_rules&amp;diff=123"/>
		<updated>2025-08-15T10:28:31Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, general rules, identifier naming conventions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Different [[Programming language|programming languages]] have different rules on how [[Identifier|identifiers]] can be named.&lt;br /&gt;
&lt;br /&gt;
== General rules ==&lt;br /&gt;
In most programming languages, you must follow these [[identifier]] naming rules:&lt;br /&gt;
&lt;br /&gt;
* The identifier cannot contain spaces&lt;br /&gt;
* The identifier can contain only numbers, letters and underscores&lt;br /&gt;
* The identifier must not start with a number&lt;br /&gt;
&lt;br /&gt;
== Identifier naming conventions ==&lt;br /&gt;
While not &#039;&#039;rules&#039;&#039;, most programming languages have conventions you should follow.&lt;br /&gt;
&lt;br /&gt;
There are also good practices to name your [[identifier]] as clearly as possible.&lt;br /&gt;
&lt;br /&gt;
See: [[Identifier naming conventions]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Condition&amp;diff=122</id>
		<title>Condition</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Condition&amp;diff=122"/>
		<updated>2025-08-15T10:23:00Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, operators, statements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;condition&#039;&#039;&#039; is a statement that evaluates to a [[boolean]] [[value]].&lt;br /&gt;
&lt;br /&gt;
They are often used in [[selection]] statements (such as [[If statement|if statements]]) to [[Code branch|branch code]] (do different things based on [[User input|input]]).&lt;br /&gt;
&lt;br /&gt;
== Conditional operators ==&lt;br /&gt;
Conditional [[Operator|operators]] are the [[syntax]] used to evaluate a statement to a [[boolean]] [[value]].&lt;br /&gt;
&lt;br /&gt;
See: [[Conditional operator]].&lt;br /&gt;
&lt;br /&gt;
== Conditional statements ==&lt;br /&gt;
Conditional &#039;&#039;&#039;statements&#039;&#039;&#039; are [[selection]]: they allow us to [[Code branch|branch code]] based on the result of a &#039;&#039;&#039;condition&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The main conditional statement is the [[if statement]], but there are other types of [[selection]], such as the [[switch statement]] and [[match statement]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=For_each_loop&amp;diff=121</id>
		<title>For each loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=For_each_loop&amp;diff=121"/>
		<updated>2025-08-15T10:22:32Z</updated>

		<summary type="html">&lt;p&gt;Dylan: Dylan moved page For each loop to Foreach loop: Misspelled title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Foreach loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Foreach_loop&amp;diff=120</id>
		<title>Foreach loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Foreach_loop&amp;diff=120"/>
		<updated>2025-08-15T10:22:31Z</updated>

		<summary type="html">&lt;p&gt;Dylan: Dylan moved page For each loop to Foreach loop: Misspelled title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;foreach loop&#039;&#039;&#039; is an [[iteration]] structure in code which allows us to loop through a [[code block]] for each [[Collection element|element]] in a [[collection]].&lt;br /&gt;
&lt;br /&gt;
It is a form of [[definite iteration]], or &#039;&#039;&#039;count-controlled&#039;&#039;&#039; [[iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
In the below [[C Sharp]] code, we loop through the [[Value|values]] of the &amp;lt;code&amp;gt;fruits&amp;lt;/code&amp;gt; array and print out each [[Collection element|element]]:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;string[] fruits = {&amp;quot;Banana&amp;quot;, &amp;quot;Apple&amp;quot;, &amp;quot;Peach&amp;quot;, &amp;quot;Strawberry&amp;quot;, &amp;quot;Raspberry&amp;quot;};&lt;br /&gt;
foreach (string fruit in fruits)&lt;br /&gt;
{&lt;br /&gt;
    Console.WriteLine(fruit);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;The code above will give the following output:&lt;br /&gt;
 Banana&lt;br /&gt;
 Apple&lt;br /&gt;
 Peach&lt;br /&gt;
 Strawberry&lt;br /&gt;
 Raspberry&lt;br /&gt;
&lt;br /&gt;
== Iterating a range of values ==&lt;br /&gt;
If you instead want to loop over a range of [[Integer|integers]] or another type of [[range]], you should instead use a regular [[for loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[For loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Foreach_loop&amp;diff=119</id>
		<title>Foreach loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Foreach_loop&amp;diff=119"/>
		<updated>2025-08-15T10:13:54Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, iterating a range&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;foreach loop&#039;&#039;&#039; is an [[iteration]] structure in code which allows us to loop through a [[code block]] for each [[Collection element|element]] in a [[collection]].&lt;br /&gt;
&lt;br /&gt;
It is a form of [[definite iteration]], or &#039;&#039;&#039;count-controlled&#039;&#039;&#039; [[iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
In the below [[C Sharp]] code, we loop through the [[Value|values]] of the &amp;lt;code&amp;gt;fruits&amp;lt;/code&amp;gt; array and print out each [[Collection element|element]]:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;string[] fruits = {&amp;quot;Banana&amp;quot;, &amp;quot;Apple&amp;quot;, &amp;quot;Peach&amp;quot;, &amp;quot;Strawberry&amp;quot;, &amp;quot;Raspberry&amp;quot;};&lt;br /&gt;
foreach (string fruit in fruits)&lt;br /&gt;
{&lt;br /&gt;
    Console.WriteLine(fruit);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;The code above will give the following output:&lt;br /&gt;
 Banana&lt;br /&gt;
 Apple&lt;br /&gt;
 Peach&lt;br /&gt;
 Strawberry&lt;br /&gt;
 Raspberry&lt;br /&gt;
&lt;br /&gt;
== Iterating a range of values ==&lt;br /&gt;
If you instead want to loop over a range of [[Integer|integers]] or another type of [[range]], you should instead use a regular [[for loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[For loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=For_loop&amp;diff=118</id>
		<title>For loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=For_loop&amp;diff=118"/>
		<updated>2025-08-15T10:07:05Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, iterating a collection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;for loop&#039;&#039;&#039; is an [[iteration]] structure in code which allows us to loop through a [[code block]] and easily [[Incrementation|increment]] a variable each time.&lt;br /&gt;
&lt;br /&gt;
It is a form of [[definite iteration]], or &#039;&#039;&#039;count-controlled&#039;&#039;&#039; [[iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
In the below [[C Sharp]] code, we loop through the numbers 1-5 and print each number to the console:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
for (int i = 1; i &amp;lt;= 5; i++)&lt;br /&gt;
{&lt;br /&gt;
    Console.WriteLine(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Iterating a collection ==&lt;br /&gt;
If you instead want to loop over a [[collection]], you can either use a regular &#039;&#039;&#039;for loop&#039;&#039;&#039; and [[Iteration|iterate]] over each [[Collection index|index]] of the [[collection]], or you can use a [[for each loop]] to iterate over the [[Collection element|elements]] themselves.&lt;br /&gt;
&lt;br /&gt;
See: [[For each loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Do_while_loop&amp;diff=117</id>
		<title>Do while loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Do_while_loop&amp;diff=117"/>
		<updated>2025-08-15T09:38:58Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, while&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;do while loop&#039;&#039;&#039; will repeat ([[Iteration|iterate]]) a [[code block]] while a [[condition]] is [[Boolean|true]], &#039;&#039;&#039;but will first check the condition &#039;&#039;after&#039;&#039; first running the codeblock&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This type of loop is known as [[indefinite iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following [[C Sharp]] code will loop until the [[User input|user enters]] &#039;stop&#039;, &#039;&#039;&#039;but the [[condition]] is only checked after the code block has first executed&#039;&#039;&#039;. This means that, even though it seems like the loop should stop right away as the [[condition]] is [[Boolean|false]], it still runs once (then the [[value]] is [[Assignment|overwritten]] anyway):&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
String input = &amp;quot;stop&amp;quot;;&lt;br /&gt;
do {&lt;br /&gt;
    input = Console.ReadLine();&lt;br /&gt;
} while (input != &amp;quot;stop&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== While loop ==&lt;br /&gt;
If you &#039;&#039;&#039;do not&#039;&#039;&#039; want the code to run at least once before checking the [[condition]] but instead want to check the condition &#039;&#039;&#039;first&#039;&#039;&#039;, you can use a [[while loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[While loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=While_loop&amp;diff=116</id>
		<title>While loop</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=While_loop&amp;diff=116"/>
		<updated>2025-08-15T09:32:49Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, do while&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;while loop&#039;&#039;&#039; will repeat ([[Iteration|iterate]]) a [[code block]] while a [[condition]] is [[Boolean|true]].&lt;br /&gt;
&lt;br /&gt;
This type of loop is known as [[indefinite iteration]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following [[C Sharp]] code will loop until the [[User input|user enters]] &#039;stop&#039;:&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
String input;&lt;br /&gt;
while (input != &amp;quot;stop&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
    input = Console.ReadLine();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do while loop ==&lt;br /&gt;
If you want the code to run at least once before checking the [[condition]], you can use a [[do while loop]].&lt;br /&gt;
&lt;br /&gt;
See: [[Do while loop]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Definite_iteration&amp;diff=115</id>
		<title>Definite iteration</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Definite_iteration&amp;diff=115"/>
		<updated>2025-08-15T09:29:22Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, examples, indefinite&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Definite&#039;&#039;&#039; [[iteration]] is where a [[code block]] is repeated a &#039;&#039;&#039;known number&#039;&#039;&#039; of times.&lt;br /&gt;
&lt;br /&gt;
It is generally &#039;&#039;&#039;count controlled&#039;&#039;&#039;, meaning the code will repeat either for different [[Value|values]] in a [[range]] ([[for loop]]), or repeat for each [[Collection element|element]] in a [[collection]] ([[foreach loop]]).&lt;br /&gt;
&lt;br /&gt;
== Examples of definite iteration ==&lt;br /&gt;
&lt;br /&gt;
* [[For loop]]&lt;br /&gt;
* [[Foreach loop]]&lt;br /&gt;
&lt;br /&gt;
== Indefinite iteration ==&lt;br /&gt;
&#039;&#039;&#039;Indefinite&#039;&#039;&#039; iteration is the opposite of definite iteration.&lt;br /&gt;
&lt;br /&gt;
See: [[Indefinite iteration]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Indefinite_iteration&amp;diff=114</id>
		<title>Indefinite iteration</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Indefinite_iteration&amp;diff=114"/>
		<updated>2025-08-15T09:24:54Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, examples, definite&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Indefinite&#039;&#039;&#039; [[iteration]] is where a [[code block]] is repeated an &#039;&#039;&#039;unknown number&#039;&#039;&#039; of times.&lt;br /&gt;
&lt;br /&gt;
It is generally &#039;&#039;&#039;[[condition]] controlled&#039;&#039;&#039;, meaning the code will repeat until a [[condition]] returns [[Boolean|false]].&lt;br /&gt;
&lt;br /&gt;
== Examples of indefinite iteration ==&lt;br /&gt;
&lt;br /&gt;
* [[While loop]]&lt;br /&gt;
* [[Do while loop]]&lt;br /&gt;
&lt;br /&gt;
== Definite iteration ==&lt;br /&gt;
Indefinite iteration is the opposite of &#039;&#039;&#039;definite&#039;&#039;&#039; iteration.&lt;br /&gt;
&lt;br /&gt;
See: [[Definite iteration]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Iteration&amp;diff=113</id>
		<title>Iteration</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Iteration&amp;diff=113"/>
		<updated>2025-08-15T09:24:25Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: links to definite and indefinite iteration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Iteration&#039;&#039;&#039; is essentially &#039;&#039;&#039;looping&#039;&#039;&#039;.&amp;lt;/blockquote&amp;gt;Loops generally involve repeating some code a certain number of times, or until a [[condition]] is met.&lt;br /&gt;
&lt;br /&gt;
== Types of iteration ==&lt;br /&gt;
There are two main forms of loops in [[Programming language|programming languages]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Count&#039;&#039;&#039; controlled: [[for loop]] or [[foreach loop]] - see [[definite iteration]].&lt;br /&gt;
* &#039;&#039;&#039;Condition&#039;&#039;&#039; controlled: [[while loop]] or [[do while loop]] - see [[indefinite iteration]].&lt;br /&gt;
&lt;br /&gt;
== Iteration and recursion ==&lt;br /&gt;
[[Recursion]] is a programming technique that often achieves the same thing as iteration. In some cases, it can be a better option than iteration.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Iteration&amp;diff=112</id>
		<title>Iteration</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Iteration&amp;diff=112"/>
		<updated>2025-08-15T09:22:28Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: do while loop in types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Iteration&#039;&#039;&#039; is essentially &#039;&#039;&#039;looping&#039;&#039;&#039;.&amp;lt;/blockquote&amp;gt;Loops generally involve repeating some code a certain number of times, or until a [[condition]] is met.&lt;br /&gt;
&lt;br /&gt;
== Types of iteration ==&lt;br /&gt;
There are two main forms of loops in [[Programming language|programming languages]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Count&#039;&#039;&#039; controlled: [[for loop]] or [[foreach loop]]&lt;br /&gt;
* &#039;&#039;&#039;Condition&#039;&#039;&#039; controlled: [[while loop]] or [[do while loop]]&lt;br /&gt;
&lt;br /&gt;
== Iteration and recursion ==&lt;br /&gt;
[[Recursion]] is a programming technique that often achieves the same thing as iteration. In some cases, it can be a better option than iteration.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Iteration&amp;diff=111</id>
		<title>Iteration</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Iteration&amp;diff=111"/>
		<updated>2025-08-15T09:15:58Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: foreach loop in types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Iteration&#039;&#039;&#039; is essentially &#039;&#039;&#039;looping&#039;&#039;&#039;.&amp;lt;/blockquote&amp;gt;Loops generally involve repeating some code a certain number of times, or until a [[condition]] is met.&lt;br /&gt;
&lt;br /&gt;
== Types of iteration ==&lt;br /&gt;
There are two main forms of loops in [[Programming language|programming languages]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Count&#039;&#039;&#039; controlled: [[for loop]] or [[foreach loop]]&lt;br /&gt;
* &#039;&#039;&#039;Condition&#039;&#039;&#039; controlled: [[while loop]]&lt;br /&gt;
&lt;br /&gt;
== Iteration and recursion ==&lt;br /&gt;
[[Recursion]] is a programming technique that often achieves the same thing as iteration. In some cases, it can be a better option than iteration.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Subroutine&amp;diff=110</id>
		<title>Subroutine</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Subroutine&amp;diff=110"/>
		<updated>2025-08-15T09:14:18Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, parameters, types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;subroutine&#039;&#039;&#039; is a [[code block]] in a separate part of the [[source code]].&lt;br /&gt;
&lt;br /&gt;
This [[code block]] can be &#039;&#039;&#039;called&#039;&#039;&#039;, or &#039;invoked&#039;, and calling the subroutine will run the code in the code block.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
Subroutines can take in [[Parameter|parameters]]. These parameters give the subroutine more information about how to run and what [[Value|values]] to act upon.&lt;br /&gt;
&lt;br /&gt;
For example, a [[function]] &amp;lt;code&amp;gt;addOne&amp;lt;/code&amp;gt; which simply returns the [[integer]] one above the [[value]] of the [[parameter]] we pass in, could take in an [[integer]] called &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; as a &#039;&#039;&#039;parameter&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Types of subroutines ==&lt;br /&gt;
&lt;br /&gt;
* [[Function]] - a subroutine which &#039;&#039;&#039;does&#039;&#039;&#039; [[return]] a [[value]].&lt;br /&gt;
* [[Procedure]] - a subroutine which &#039;&#039;&#039;does not&#039;&#039;&#039; [[Function return|return]] a [[value]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Coderwiki:Copyrights&amp;diff=109</id>
		<title>Coderwiki:Copyrights</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Coderwiki:Copyrights&amp;diff=109"/>
		<updated>2025-08-15T09:13:39Z</updated>

		<summary type="html">&lt;p&gt;Dylan: add: no responsibility for copyrighted content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All content on this site is licensed under Creative Commons Attribution.&lt;br /&gt;
&lt;br /&gt;
Attribution must be a link to a wiki page on this site and must be presented in a location that is &#039;&#039;hard to miss&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Submitting content ==&lt;br /&gt;
&lt;br /&gt;
Any content submitted to this wiki will be freely available to anyone under the Creative Commons Attribution license. If you do not want your work distributed under this license, do not publish to this wiki.&lt;br /&gt;
&lt;br /&gt;
You must have full ownership over any resources you use in content you publish here, or resources used &#039;&#039;&#039;must&#039;&#039;&#039; be in the public domain.&lt;br /&gt;
&lt;br /&gt;
No responsibility will be taken for copyrighted content on this site, it is entirely up to users to ensure any submitted content is copyright-free. We will take down any copyrighted content upon request.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Procedure&amp;diff=108</id>
		<title>Procedure</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Procedure&amp;diff=108"/>
		<updated>2025-08-15T09:05:18Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A procedure is simply a [[subroutine]] that does not [[Function return|return]] a [[value]].&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
	<entry>
		<id>http://coderwiki.org/index.php?title=Enum&amp;diff=107</id>
		<title>Enum</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Enum&amp;diff=107"/>
		<updated>2025-08-15T09:04:13Z</updated>

		<summary type="html">&lt;p&gt;Dylan: new: info, example, other sum, other algebraic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;enum&#039;&#039;&#039; is a [[sum type]] (a type of [[algebraic data type]]) in which its [[value]] represents one of a set number of possible states.&lt;br /&gt;
&lt;br /&gt;
This makes [[Invalid state|invalid states]] unrepresentable, as the [[variable]] of the enum [[data type]] can &#039;&#039;&#039;only&#039;&#039;&#039; store certain [[Value|values]], nothing else.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Say you are writing a program to track animals in a zoo.&lt;br /&gt;
&lt;br /&gt;
You could have an &#039;&#039;&#039;enum&#039;&#039;&#039; type called &amp;lt;code&amp;gt;Animal&amp;lt;/code&amp;gt; to store the different animals in the zoo. [[Variable|Variables]] of this [[Data type|type]] could then only contain one of four [[Value|values]]:&lt;br /&gt;
&lt;br /&gt;
* Parrot&lt;br /&gt;
* Monkey&lt;br /&gt;
* Tiger&lt;br /&gt;
* Giraffe&lt;br /&gt;
&lt;br /&gt;
This has the benefit of making [[invalid state]] impossible: we are guaranteed that the value of an &amp;lt;code&amp;gt;Animal&amp;lt;/code&amp;gt; [[variable]] will always be one of the 4 above.&lt;br /&gt;
&lt;br /&gt;
== Other sum types ==&lt;br /&gt;
See: [[Sum type]]&lt;br /&gt;
&lt;br /&gt;
== Other algebraic data types ==&lt;br /&gt;
See: [[Algebraic data type]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
</feed>