Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board Scroll Array algorithm Download Source Code
Author Details Code Information
shadytyrant ( Travus )

Pinned 5 Codes
Posted 5 Coding Articles

Send A Message
View Coders Profile
Language C# (C Sharp)
Expires Never
Length 624 Characters (27 Lines)
Password no password
Description

Scroll an array to the right and move the last char to the front
  1. public char[] ScrollArray(char[] charArray)
  2. {
  3.     char[] newArray = new char[charArray.Length];
  4.  
  5.     int j = 0;
  6.     for (int k = 0; k < charArray.Length; k++)
  7.     {
  8.         if (k + 1 < charArray.Length)
  9.         {
  10.             newArray[k + 1] = charArray[k];
  11.         }
  12.         else
  13.         {
  14.             newArray[j] = charArray[k];
  15.             j++;
  16.         }
  17.     }
  18.     return newArray;
  19. }
  20.  
  21. // ### Possible Use ###
  22. private void OnTick(object sender, EventArgs e)
  23. {
  24.     char[] charArray = label1.Text.ToCharArray();
  25.     char[] newArray = ScrollArray(charArray);
  26.     label1.Text = new string(newArray);
  27. }
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
If you made money from keeping your profile up to date, say $30 and up, per month. What extra time would you spend on your profile?

No extra time
A few hours at weekends
A whole day each week
Every minute i can get free


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.49 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved