Need very short program

Discussion in 'Programming General' started by Zuzel111, Jan 11, 2013.

Need very short program
  1. Unread #1 - Jan 11, 2013 at 6:57 AM
  2. Zuzel111
    Joined:
    Mar 26, 2011
    Posts:
    16,736
    Referrals:
    336
    Sythe Gold:
    4,084
    Vouch Thread:
    Click Here
    Discord Unique ID:
    377271265838366730
    Discord Username:
    spartars
    Two Factor Authentication User Sythe Awards 2013 Winner MushyMuncher Pokémon Trainer St. Patrick's Day 2013 Easter 2013 Lumpy Space Princess Sythe RSPS Player Halloween 2013
    Christmas 2013 Gohan has AIDS <3 n4n0 Tortoise Penis Heidy UWotM8? Shitting Rainbow Former OMM Hey... this isnt a fun rank
    Supporting Business Spyro Potamus Extreme Homosex St. Patrick's Day 2014 Sythe's 10th Anniversary

    Zuzel111 www.Sparta.Rs - #1 Fire Cape service 1 Def 1 Pray
    Zuzel111 Donor Retired Sectional Moderator

    Need very short program

    I need very short program, preferably source code
    Program must display all possible 3 symbol combinations and 2 symbols. It can run in CMD
    A-Z
    0-9
     
  3. Unread #2 - Jan 11, 2013 at 7:58 PM
  4. RuneScapeJJ
    Joined:
    Aug 14, 2011
    Posts:
    1,522
    Referrals:
    1
    Sythe Gold:
    0
    Potamus

    RuneScapeJJ Guru
    $25 USD Donor New

    Need very short program

    On my phone but for simba
    Procedure generate:
    Var
    I, j: integer;
    Options: tstringarray;

    Begin
    Options := ['a', etc.];
    For i:=0 to high(options) do
    For j:=0 to high(options) do
    Writeln(options + options[j]);
    End;
     
  5. Unread #3 - Jan 12, 2013 at 2:23 AM
  6. Zuzel111
    Joined:
    Mar 26, 2011
    Posts:
    16,736
    Referrals:
    336
    Sythe Gold:
    4,084
    Vouch Thread:
    Click Here
    Discord Unique ID:
    377271265838366730
    Discord Username:
    spartars
    Two Factor Authentication User Sythe Awards 2013 Winner MushyMuncher Pokémon Trainer St. Patrick's Day 2013 Easter 2013 Lumpy Space Princess Sythe RSPS Player Halloween 2013
    Christmas 2013 Gohan has AIDS <3 n4n0 Tortoise Penis Heidy UWotM8? Shitting Rainbow Former OMM Hey... this isnt a fun rank
    Supporting Business Spyro Potamus Extreme Homosex St. Patrick's Day 2014 Sythe's 10th Anniversary

    Zuzel111 www.Sparta.Rs - #1 Fire Cape service 1 Def 1 Pray
    Zuzel111 Donor Retired Sectional Moderator

    Need very short program

    [Error] (7:18): Unknown identifier 'etc' at line 6
    Compiling failed.
     
  7. Unread #4 - Jan 12, 2013 at 4:20 AM
  8. novice
    Joined:
    Jun 21, 2008
    Posts:
    111
    Referrals:
    0
    Sythe Gold:
    0

    novice Active Member

    Need very short program

    You are supposed to replace the "etc" with all the possible characters.
    eg:

    Options := ['a', 'b', 'c', 'd'];
     
  9. Unread #5 - Jan 12, 2013 at 6:59 AM
  10. Zuzel111
    Joined:
    Mar 26, 2011
    Posts:
    16,736
    Referrals:
    336
    Sythe Gold:
    4,084
    Vouch Thread:
    Click Here
    Discord Unique ID:
    377271265838366730
    Discord Username:
    spartars
    Two Factor Authentication User Sythe Awards 2013 Winner MushyMuncher Pokémon Trainer St. Patrick's Day 2013 Easter 2013 Lumpy Space Princess Sythe RSPS Player Halloween 2013
    Christmas 2013 Gohan has AIDS <3 n4n0 Tortoise Penis Heidy UWotM8? Shitting Rainbow Former OMM Hey... this isnt a fun rank
    Supporting Business Spyro Potamus Extreme Homosex St. Patrick's Day 2014 Sythe's 10th Anniversary

    Zuzel111 www.Sparta.Rs - #1 Fire Cape service 1 Def 1 Pray
    Zuzel111 Donor Retired Sectional Moderator

    Need very short program

    Procedure generate;
    Var
    I, j: integer;
    Options: tstringarray;

    Begin
    Options := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','r','s','t','u','w','z','x','y','-','1','2','3','4','5','6','7','8','9','0'];
    For i:=0 to high(options) do
    For j:=0 to high(options) do
    Writeln(options + options[j]);
    End;

    [Error] (8:112): Closing square bracket (']') expected at line 7
    Compiling failed.
    [Error] (7:112): Closing square bracket (']') expected at line 6
    Compiling failed.
    [Error] (2:19): Semicolon (';') expected at line 1
    Compiling failed.
    [Error] (8:112): Closing square bracket (']') expected at line 7
    Compiling failed.
     
  11. Unread #6 - Jan 13, 2013 at 2:10 AM
  12. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Need very short program

    Seeing as this is the Visual Basic forum, I assume you wanted to use Visual Basic?

    Code:
            'The Array of Characters...
            Dim characters = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
    
            '2 Character Combinations...
            For i As Integer = 0 To characters.GetUpperBound(0)
                For o As Integer = 0 To characters.GetUpperBound(0)
                    Console.WriteLine(characters(i) + characters(o))
                Next
            Next
    
            '3 Character Combinations...
            For i As Integer = 0 To characters.GetUpperBound(0)
                For o As Integer = 0 To characters.GetUpperBound(0)
                    For p As Integer = 0 To characters.GetUpperBound(0)
                        Console.WriteLine(characters(i) + characters(o) + characters(p))
                    Next
                Next
            Next
    But maybe you want to use C#?
    Code:
                //The Array of Characters...
                    string[] characters = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
    
                //2 Character Combinations...
                for (int i = 0; i < characters.GetUpperBound(0); i++)
                {
                    for (int o = 0; o < characters.GetUpperBound(0); o++)
                    {
                        Console.WriteLine(characters[i] + characters[o]);
                    }
                }
    
                //3 Character Combinations...
                for (int i = 0; i < characters.GetUpperBound(0); i++)
                {
                    for (int o = 0; o < characters.GetUpperBound(0); o++)
                    {
                        for (int p = 0; p < characters.GetUpperBound(0); p++)
                        {
                            Console.WriteLine(characters[i] + characters[o] + characters[p]);
                        }
                    }
                }
     
< Can't download Java | Looking for a tutorial (exe) i once possessed >

Users viewing this thread
1 guest


 
 
Adblock breaks this site