https://www.trccompsci.online/mediawiki/api.php?action=feedcontributions&user=Robbie+Rotten&feedformat=atomTRCCompSci - AQA Computer Science - User contributions [en-gb]2024-03-28T17:13:57ZUser contributionsMediaWiki 1.31.6https://www.trccompsci.online/mediawiki/index.php?title=Provide_a_method_for_the_player_to_swap_5_random_tiles_from_their_hand&diff=4149Provide a method for the player to swap 5 random tiles from their hand2017-11-16T10:27:42Z<p>Robbie Rotten: /* Simple Method */</p>
<hr />
<div>To do this we must firstly add a new command to the GetChoice Method for this.<br />
<br />
<syntaxhighlight lang="C#"><br />
private static string GetChoice() {<br />
string Choice;<br />
Console.WriteLine();<br />
Console.WriteLine("Either:");<br />
Console.WriteLine(" enter the word you would like to play OR");<br />
Console.WriteLine(" press 1 to display the letter values OR");<br />
Console.WriteLine(" press 4 to view the tile queue OR");<br />
Console.WriteLine(" press 7 to view your tiles again OR");<br />
Console.WriteLine(" press 5 to swap 5 random tiles from hand"); // <- New Command here <br />
Console.WriteLine(" press 0 to fill hand and stop the game.");<br />
Console.Write("> ");<br />
Choice = Console.ReadLine();<br />
Console.WriteLine();<br />
Choice = Choice.ToUpper();<br />
return Choice;<br />
}<br />
</syntaxhighlight><br />
<br />
Then we need to actually add the logic for the command in the HaveTurn method with a new else-if/choice for 5.<br />
<br />
==Simple Method==<br />
<br />
<syntaxhighlight lang="C#"><br />
Random random = new Random();<br />
for (int i = 0; i < 5; i++)<br />
{<br />
PlayerTiles = PlayerTiles.Remove(random.Next(0,PlayerTiles.Length-1),1);<br />
string newtile = TileQueue.Remove();<br />
PlayerTiles = PlayerTiles + newtile;<br />
}<br />
Console.WriteLine("New hand:" + PlayerTiles);<br />
</syntaxhighlight><br />
This method creates a random number, and then a for loop is made for 5 tiles.<br />
Then the code removes 1 random tile from the list of player tiles (the reason it is PlayerTiles.Length-1 is because the list starts at one, whilst the position starts at 0).<br />
It then adds 1 new tile to the end and repeats the process 5 times.<br />
<br />
==Advanced Method==<br />
<syntaxhighlight lang="C#"><br />
// Some stuff was here<br />
<br />
else if (Choice == "5") { // Swap 5 random tiles command<br />
Random random = new Random(); // To select tiles to remove<br />
<br />
foreach (int X in Enumerable.Range(0, 5)) {<br />
String newTile = TileQueue.Remove(); // Get New Tile for hand<br />
TileQueue.Add(); // Replace taken tile with random new one<br />
int removalTileIndex = random.Next(0, PlayerName.Length-1);<br />
<br />
PlayerTiles = PlayerTiles.Remove(removalTileIndex, 1).Insert(removalTileIndex, newTile);<br />
}<br />
<br />
Console.WriteLine("New Hand: {0}", PlayerTiles);<br />
}<br />
<br />
// Some stuff was here<br />
</syntaxhighlight><br />
<br />
The only part of the above method which I feel may be somewhat confusing is the assignment of the PlayerTiles variable. "String".Remove() and "String".Insert() both return a new string with the desired logic of the method executed. Meaning u can chain these commands as I've done above instead of perhaps doing this: <br />
<br />
<syntaxhighlight lang="C#"><br />
String removed = PlayerTiles.Remove(removalTileIndex, 1);<br />
String inserted = removed.Insert(removalTileIndex, newTile);<br />
PlayerTiles = inserted;<br />
</syntaxhighlight><br />
<br />
You cannot, NO MATTER WHAT, just call the instance method PlayerTiles.Remove() or PlayerTiles.Insert() and expect PlayerTiles variable to have that value stored automatically. Both these methods return a new string instead of changing the existing string upon which they are run.<br />
<br />
Aside from that, I feel this method is quite simple.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Provide_a_method_for_the_player_to_swap_5_random_tiles_from_their_hand&diff=4147Provide a method for the player to swap 5 random tiles from their hand2017-11-16T10:19:25Z<p>Robbie Rotten: /* Simple Method */</p>
<hr />
<div>To do this we must firstly add a new command to the GetChoice Method for this.<br />
<br />
<syntaxhighlight lang="C#"><br />
private static string GetChoice() {<br />
string Choice;<br />
Console.WriteLine();<br />
Console.WriteLine("Either:");<br />
Console.WriteLine(" enter the word you would like to play OR");<br />
Console.WriteLine(" press 1 to display the letter values OR");<br />
Console.WriteLine(" press 4 to view the tile queue OR");<br />
Console.WriteLine(" press 7 to view your tiles again OR");<br />
Console.WriteLine(" press 5 to swap 5 random tiles from hand"); // <- New Command here <br />
Console.WriteLine(" press 0 to fill hand and stop the game.");<br />
Console.Write("> ");<br />
Choice = Console.ReadLine();<br />
Console.WriteLine();<br />
Choice = Choice.ToUpper();<br />
return Choice;<br />
}<br />
</syntaxhighlight><br />
<br />
Then we need to actually add the logic for the command in the HaveTurn method with a new else-if/choice for 5.<br />
<br />
==Simple Method==<br />
<br />
<syntaxhighlight lang="C#"><br />
Random random = new Random();<br />
for (int i = 0; i < 5; i++)<br />
{<br />
PlayerTiles = PlayerTiles.Remove(random.Next(0,PlayerTiles.Length-1),1);<br />
string newtile = TileQueue.Remove();<br />
PlayerTiles = PlayerTiles + newtile;<br />
}<br />
Console.WriteLine("New hand:" + PlayerTiles);<br />
</syntaxhighlight><br />
<br />
==Advanced Method==<br />
<syntaxhighlight lang="C#"><br />
// Some stuff was here<br />
<br />
else if (Choice == "5") { // Swap 5 random tiles command<br />
Random random = new Random(); // To select tiles to remove<br />
<br />
foreach (int X in Enumerable.Range(0, 5)) {<br />
String newTile = TileQueue.Remove(); // Get New Tile for hand<br />
TileQueue.Add(); // Replace taken tile with random new one<br />
int removalTileIndex = random.Next(0, PlayerName.Length-1);<br />
<br />
PlayerTiles = PlayerTiles.Remove(removalTileIndex, 1).Insert(removalTileIndex, newTile);<br />
}<br />
<br />
Console.WriteLine("New Hand: {0}", PlayerTiles);<br />
}<br />
<br />
// Some stuff was here<br />
</syntaxhighlight><br />
<br />
The only part of the above method which I feel may be somewhat confusing is the assignment of the PlayerTiles variable. "String".Remove() and "String".Insert() both return a new string with the desired logic of the method executed. Meaning u can chain these commands as I've done above instead of perhaps doing this: <br />
<br />
<syntaxhighlight lang="C#"><br />
String removed = PlayerTiles.Remove(removalTileIndex, 1);<br />
String inserted = removed.Insert(removalTileIndex, newTile);<br />
PlayerTiles = inserted;<br />
</syntaxhighlight><br />
<br />
You cannot, NO MATTER WHAT, just call the instance method PlayerTiles.Remove() or PlayerTiles.Insert() and expect PlayerTiles variable to have that value stored automatically. Both these methods return a new string instead of changing the existing string upon which they are run.<br />
<br />
Aside from that, I feel this method is quite simple.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Provide_a_method_for_the_player_to_swap_5_random_tiles_from_their_hand&diff=4146Provide a method for the player to swap 5 random tiles from their hand2017-11-16T10:18:43Z<p>Robbie Rotten: </p>
<hr />
<div>To do this we must firstly add a new command to the GetChoice Method for this.<br />
<br />
<syntaxhighlight lang="C#"><br />
private static string GetChoice() {<br />
string Choice;<br />
Console.WriteLine();<br />
Console.WriteLine("Either:");<br />
Console.WriteLine(" enter the word you would like to play OR");<br />
Console.WriteLine(" press 1 to display the letter values OR");<br />
Console.WriteLine(" press 4 to view the tile queue OR");<br />
Console.WriteLine(" press 7 to view your tiles again OR");<br />
Console.WriteLine(" press 5 to swap 5 random tiles from hand"); // <- New Command here <br />
Console.WriteLine(" press 0 to fill hand and stop the game.");<br />
Console.Write("> ");<br />
Choice = Console.ReadLine();<br />
Console.WriteLine();<br />
Choice = Choice.ToUpper();<br />
return Choice;<br />
}<br />
</syntaxhighlight><br />
<br />
Then we need to actually add the logic for the command in the HaveTurn method with a new else-if/choice for 5.<br />
<br />
==Simple Method==<br />
<br />
<syntaxhighlight lang="C#"><br />
Random random = new Random();<br />
for (int i = 0; i < 5; i++)<br />
{<br />
PlayerTiles = PlayerTiles.Remove(random.Next(0,PlayerTiles.Length-1),1);<br />
string newtile = TileQueue.Remove();<br />
PlayerTiles = PlayerTiles + newtile;<br />
}<br />
Console.WriteLine("New hand:" + PlayerTiles);<br />
</syntaxhighlight><br />
<br />
==Advanced Method==<br />
<syntaxhighlight lang="C#"><br />
// Some stuff was here<br />
<br />
else if (Choice == "5") { // Swap 5 random tiles command<br />
Random random = new Random(); // To select tiles to remove<br />
<br />
foreach (int X in Enumerable.Range(0, 5)) {<br />
String newTile = TileQueue.Remove(); // Get New Tile for hand<br />
TileQueue.Add(); // Replace taken tile with random new one<br />
int removalTileIndex = random.Next(0, PlayerName.Length-1);<br />
<br />
PlayerTiles = PlayerTiles.Remove(removalTileIndex, 1).Insert(removalTileIndex, newTile);<br />
}<br />
<br />
Console.WriteLine("New Hand: {0}", PlayerTiles);<br />
}<br />
<br />
// Some stuff was here<br />
</syntaxhighlight><br />
<br />
The only part of the above method which I feel may be somewhat confusing is the assignment of the PlayerTiles variable. "String".Remove() and "String".Insert() both return a new string with the desired logic of the method executed. Meaning u can chain these commands as I've done above instead of perhaps doing this: <br />
<br />
<syntaxhighlight lang="C#"><br />
String removed = PlayerTiles.Remove(removalTileIndex, 1);<br />
String inserted = removed.Insert(removalTileIndex, newTile);<br />
PlayerTiles = inserted;<br />
</syntaxhighlight><br />
<br />
You cannot, NO MATTER WHAT, just call the instance method PlayerTiles.Remove() or PlayerTiles.Insert() and expect PlayerTiles variable to have that value stored automatically. Both these methods return a new string instead of changing the existing string upon which they are run.<br />
<br />
Aside from that, I feel this method is quite simple.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=If_the_player_spells_a_ten_or_more_letter_word,_they_should_receive_a_200_point_bonus&diff=3871If the player spells a ten or more letter word, they should receive a 200 point bonus2017-11-14T11:46:16Z<p>Robbie Rotten: </p>
<hr />
<div><syntaxhighlight lang = csharp><br />
<br />
if (Word.Length > 10)<br />
{<br />
score = score + 200;<br />
}<br />
</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=If_the_player_spells_a_ten_or_more_letter_word,_they_should_receive_a_200_point_bonus&diff=3870If the player spells a ten or more letter word, they should receive a 200 point bonus2017-11-14T11:42:30Z<p>Robbie Rotten: Created page with "<syntax highlight lang = csharp> if (Word.Length > 10) { score = score + 200; } </syntax highlight>"</p>
<hr />
<div><syntax highlight lang = csharp><br />
if (Word.Length > 10)<br />
{<br />
score = score + 200;<br />
}<br />
</syntax highlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=UpdateAfterAllowedWord&diff=3864UpdateAfterAllowedWord2017-11-14T11:35:07Z<p>Robbie Rotten: </p>
<hr />
<div><syntaxhighlight lang=csharp><br />
private static void UpdateAfterAllowedWord(string Word, ref string PlayerTiles, ref int PlayerScore, ref int PlayerTilesPlayed, Dictionary<char, int> TileDictionary, List<string> AllowedWords)<br />
{<br />
PlayerTilesPlayed = PlayerTilesPlayed + Word.Length;<br />
foreach (var Letter in Word)<br />
{<br />
PlayerTiles = PlayerTiles.Remove(PlayerTiles.IndexOf(Letter), 1);<br />
}<br />
PlayerScore = PlayerScore + GetScoreForWord(Word, TileDictionary);<br />
}<br />
</syntaxhighlight><br />
The code here passes variables for the Word, PlayerTiles, PlayerScore, PlayerTilesPlayed, TileDictionary and AllowedWords.<br />
It then adds the word length to the tiles played and then removes the amount of player tiles used to create the word, updating the available tiles to the player.<br />
The code then adds the score for the written word after checking the tile dictionary to work out its value, onto the existing score of the player.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=UpdateAfterAllowedWord&diff=3851UpdateAfterAllowedWord2017-11-14T11:15:10Z<p>Robbie Rotten: Created page with "<syntaxhighlight lang=csharp> private static void UpdateAfterAllowedWord(string Word, ref string PlayerTiles, ref int PlayerScore, ref int PlayerTilesPlayed, Dictionary<char,..."</p>
<hr />
<div><syntaxhighlight lang=csharp><br />
private static void UpdateAfterAllowedWord(string Word, ref string PlayerTiles, ref int PlayerScore, ref int PlayerTilesPlayed, Dictionary<char, int> TileDictionary, List<string> AllowedWords)<br />
{<br />
PlayerTilesPlayed = PlayerTilesPlayed + Word.Length;<br />
foreach (var Letter in Word)<br />
{<br />
PlayerTiles = PlayerTiles.Remove(PlayerTiles.IndexOf(Letter), 1);<br />
}<br />
PlayerScore = PlayerScore + GetScoreForWord(Word, TileDictionary);<br />
}<br />
</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Challenges_facing_legislators_in_the_digital_age_-_BE&diff=1536Challenges facing legislators in the digital age - BE2017-02-16T10:20:34Z<p>Robbie Rotten: </p>
<hr />
<div>==Difficulties==<br />
It is hard for legislators to make decisions regarding the laws on computing, as often the ways data is used is subjective, and no factual decisions can be made regarding it. One of these issues is down to the fact that data can be used by companies without the consent of the user. Such companies often have intentions which only benefit themselves, but data can also be used in ways which benefit the user, or even vast amounts of people in the cases of disease tracking. Whether this kind of data usage should be banned is a hard decision for legislators, as the positive uses of the data can be beneficial to mankind, but this is drowned out by the selfish uses of the data by corporations.<br />
<br />
Adding to the difficulty of legislation creation, country differences can cause issues, as some countries and cultures have different laws and opinions on the way data should be used. This means deciding who gets the final say in the matter is near impossible due to personal bias.<br />
<br />
In addition, because companies are able to track your every move online, peoples' personal privacy is shrunk to almost nothing. This is considered by legislators to be an ethical problem, which is not easily solved through law.<br />
<br />
==Opinions==<br />
I strongly believe that no country should enforces its own laws on the internet due to cultural differences as no two countries share the same laws meaning a socially acceptable act in one part of the world will be illegal in another and if a single country held control over the internet, it would take freedom from diverse populations, with their own laws being nullified when on the best source of entertainment and news there is. <br />
<br />
The law should at the most be restricted to the country that the individual accessed the internet in as it would allow each country's citizens to have their freedoms and it would be easier to enforce the law on the people in said country. this is a far better alternative as to letting one country to have dominion over the web, simply because it gives to much control to one place.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Selection&diff=445Selection2016-12-15T10:21:12Z<p>Robbie Rotten: </p>
<hr />
<div>Selection uses if statements and switch statements.<br />
* if statements work by performing an action only if a condition is reached.<br />
<syntaxhighlight lang="csharp" line> if (a > b)<br />
{ Console.WriteLine("A is greater than B"); }</syntaxhighlight> <br />
I can also be paired with else, which will perform an action if the "if" condition is not met.<br />
* switch is basically a combined if and if else statement, and is used for a lot of different options.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
}</syntaxhighlight> <br />
Default is an optional part of the switch method, which is used in case none of the other conditions are met.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
default:<br />
x*= x;<br />
break;<br />
}</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Selection&diff=444Selection2016-12-15T10:19:48Z<p>Robbie Rotten: Created page with "Selection uses if statements and switch statements. * if statements work by performing an action only if a condition is reached. <syntaxhighlight lang="csharp" line> if (a > b..."</p>
<hr />
<div>Selection uses if statements and switch statements.<br />
* if statements work by performing an action only if a condition is reached.<br />
<syntaxhighlight lang="csharp" line> if (a > b)<br />
{ Console.WriteLine("A is greater than B"); }</syntaxhighlight> <br />
I can also be paired with else, which will perform an action if the "if" condition is not met.<br />
* switch is basically a combined if and if else statement, and is used for a lot of different options.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ case 1:<br />
x++<br />
break;<br />
case 2:<br />
x--<br />
break;<br />
}</syntaxhighlight> <br />
Default is an optional part of the switch method, which is used in case none of the other conditions are met.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ case 1:<br />
x++<br />
break;<br />
case 2:<br />
x--<br />
break;<br />
default:<br />
x*= x<br />
break;<br />
}</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=442Repetition - Iteration2016-12-15T10:06:08Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration. <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight><br />
An iteration is when a piece of code is repeated until a condition is reached.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=440Repetition - Iteration2016-12-15T10:05:46Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight><br />
An iteration is when a piece of code is repeated until a condition is reached.</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=439Repetition - Iteration2016-12-15T10:03:52Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=438Repetition - Iteration2016-12-15T10:03:31Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=436Repetition - Iteration2016-12-15T10:02:54Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=435Repetition - Iteration2016-12-15T10:02:46Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=434Repetition - Iteration2016-12-15T10:02:20Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* While uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight><br />
* For loops intialise a variable, check a condition and perform an action. This is done before each iteration.<br />
<syntaxhighlight lang="csharp" line>for (int i = 0; i <= 1000000; i++)<br />
{<br />
}</syntaxhighlight> <br />
*Do while is the same as a while, however it doesn't check until it has done one iteration <br />
<syntaxhighlight lang="csharp" line> do {<br />
x ++<br />
}<br />
while (true)</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=429Repetition - Iteration2016-12-15T09:54:56Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* while uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=428Repetition - Iteration2016-12-15T09:54:46Z<p>Robbie Rotten: </p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* while uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Repetition_-_Iteration&diff=427Repetition - Iteration2016-12-15T09:54:27Z<p>Robbie Rotten: Created page with "Repetition is the use of a for loop to execute one piece of code over and over. There are multiple ways to create a for loop though. These are: * while uses one condition that..."</p>
<hr />
<div>Repetition is the use of a for loop to execute one piece of code over and over.<br />
There are multiple ways to create a for loop though. These are:<br />
* while uses one condition that which if met, will repeat the code.<br />
<syntaxhighlight lang="csharp" line> while (true)<br />
{<br />
x ++<br />
}</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=425Constants - Variables - Data Types2016-12-15T09:47:57Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>true</syntaxhighlight> <br />
<br />
*String is used for storing characters in word form.<br />
<br />
<syntaxhighlight lang="csharp" line>"hello world"</syntaxhighlight><br />
<br />
*Integer is used to store whole numbers (32 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>457568368</syntaxhighlight><br />
<br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>3.3</syntaxhighlight><br />
<br />
*decimal is used for numbers only after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>.3</syntaxhighlight><br />
<br />
*Character is used to store single letters.<br />
<br />
<syntaxhighlight lang="csharp" line>'A'</syntaxhighlight><br />
<br />
*Byte is used to store a byte( eight 1's or 0's).<br />
<br />
<syntaxhighlight lang="csharp" line>00101101</syntaxhighlight><br />
<br />
*Float is used to store a set number of digits after a decimal place.<br />
<br />
<syntaxhighlight lang="csharp" line>3.0000000000</syntaxhighlight><br />
<br />
*Long integer is also used to store whole numbers (However these are 64 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>7846354759340276482</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=424Constants - Variables - Data Types2016-12-15T09:47:19Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>bool test = true;</syntaxhighlight> <br />
<br />
*String is used for storing characters in word form.<br />
<br />
<syntaxhighlight lang="csharp" line>"hello world"</syntaxhighlight><br />
<br />
*Integer is used to store whole numbers (32 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>457568368</syntaxhighlight><br />
<br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>3.3</syntaxhighlight><br />
<br />
*decimal is used for numbers only after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>.3</syntaxhighlight><br />
<br />
*Character is used to store single letters.<br />
<br />
<syntaxhighlight lang="csharp" line>'A'</syntaxhighlight><br />
<br />
*Byte is used to store a byte( eight 1's or 0's).<br />
<br />
<syntaxhighlight lang="csharp" line>00101101</syntaxhighlight><br />
<br />
*Float is used to store a set number of digits after a decimal place.<br />
<br />
<syntaxhighlight lang="csharp" line>3.0000000000</syntaxhighlight><br />
<br />
*Long integer is also used to store whole numbers (However these are 64 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>7846354759340276482</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=423Constants - Variables - Data Types2016-12-15T09:46:43Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>bool test = true;</syntaxhighlight> <br />
<br />
*String is used for storing characters in word form.<br />
<br />
<syntaxhighlight lang="csharp" line>"hello world"</syntaxhighlight><br />
<br />
*Integer is used to store whole numbers (32 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>457568368</syntaxhighlight><br />
<br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>3.3</syntaxhighlight><br />
<br />
*decimal is used for numbers only after the decimal point.<br />
<br />
<syntaxhighlight lang="csharp" line>.3</syntaxhighlight><br />
<br />
*Character is used to store single letters.<br />
<br />
<syntaxhighlight lang="csharp" line>'A'</ syntaxhighlight><br />
<br />
*Byte is used to store a byte( eight 1's or 0's).<br />
<br />
<syntaxhighlight lang="csharp" line>00101101</syntaxhighlight><br />
<br />
*Float is used to store a set number of digits after a decimal place.<br />
<br />
<syntaxhighlight lang="csharp" line>3.0000000000</syntaxhighlight><br />
<br />
*Long integer is also used to store whole numbers (However these are 64 bit values).<br />
<br />
<syntaxhighlight lang="csharp" line>7846354759340276482</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=420Constants - Variables - Data Types2016-12-15T09:45:25Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>bool test = true;</syntaxhighlight> <br />
<br />
*String is used for storing characters in word form.<br />
<syntaxhighlight lang="csharp" line>"hello world"</syntaxhighlight> <br />
*Integer is used to store whole numbers (32 bit values).<br />
<syntaxhighlight lang="csharp" line>457568368</syntaxhighlight> <br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
<syntaxhighlight lang="csharp" line>3.3</syntaxhighlight> <br />
*decimal is used for numbers only after the decimal point.<br />
<syntaxhighlight lang="csharp" line>.3</syntaxhighlight> <br />
*Character is used to store single letters.<br />
<syntaxhighlight lang="csharp" line>'A'</ syntaxhighlight> <br />
*Byte is used to store a byte( eight 1's or 0's).<br />
<syntaxhighlight lang="csharp" line>00101101</syntaxhighlight> <br />
*Float is used to store a set number of digits after a decimal place.<br />
<syntaxhighlight lang="csharp" line>3.0000000000</syntaxhighlight> <br />
*Long integer is also used to store whole numbers (However these are 64 bit values).<br />
<syntaxhighlight lang="csharp" line>7846354759340276482</syntaxhighlight></div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=408Constants - Variables - Data Types2016-12-15T09:36:42Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false.<br />
<br />
<syntaxhighlight lang="csharp" line> <br />
bool test = true;<br />
<br />
</syntaxhighlight> <br />
<br />
*String is used for storing characters in word form. <br />
*Integer is used to store whole numbers (32 bit values).<br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
*decimal is used for numbers only after the decimal point.<br />
*Character is used to store single letters.<br />
*Byte is used to store a byte( eight 1's or 0's).<br />
*Float is used to store a set number of digits after a decimal place.<br />
*Long integer is also used to store whole numbers (However these are 64 bit values).</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=407Constants - Variables - Data Types2016-12-15T09:35:11Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value, being either true or false. <br />
*String is used for storing characters in word form. <br />
*Integer is used to store whole numbers (32 bit values).<br />
*Double is used to store numbers where there are numbers before and after the decimal point.<br />
*decimal is used for numbers only after the decimal point.<br />
*Character is used to store single letters.<br />
*Byte is used to store a byte( eight 1's or 0's).<br />
*Float is used to store a set number of digits after a decimal place.<br />
*Long integer is also used to store whole numbers (However these are 64 bit values).</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=403Constants - Variables - Data Types2016-12-15T09:29:07Z<p>Robbie Rotten: </p>
<hr />
<div>There are 9 types of data types. These include Boolean, string, integer, double, decimal, character, byte, float and long.<br />
<br />
*Boolean is a binary value is true or false. <br />
*String is used for storing characters in word form. <br />
Integer is used to store whole numbers.<br />
Double is used to store numbers where there are numbers before and after the decimal point.<br />
decimal is used for numbers only after the decimal point.<br />
Character is used to store single letters.<br />
Byte is used to store a byte( eight 1's or 0's).</div>Robbie Rottenhttps://www.trccompsci.online/mediawiki/index.php?title=Constants_-_Variables_-_Data_Types&diff=400Constants - Variables - Data Types2016-12-15T09:28:29Z<p>Robbie Rotten: Created page with "There are 9 types of data types. These include Boolean, string, integer, double, decimal, character, byte, float and long. Boolean is a binary value is true or false. String..."</p>
<hr />
<div>There are 9 types of data types. These include Boolean, string, integer, double, decimal, character, byte, float and long.<br />
Boolean is a binary value is true or false. <br />
String is used for storing characters in word form. <br />
Integer is used to store whole numbers.<br />
Double is used to store numbers where there are numbers before and after the decimal point.<br />
decimal is used for numbers only after the decimal point.<br />
Character is used to store single letters.<br />
Byte is used to store a byte( eight 1's or 0's).</div>Robbie Rotten