Results 1 to 7 of 7

Thread: Crossfoot

  1. #1
    Join Date
    Mar 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Crossfoot

    hi
    i have made a Crossfoot function
    now i hope i can explain it good enough for all of you, so you can understand it ;D

    Crossfoot is when you take each part(?) of a minimum 2 digit and then you take each part and add them to each other
    for example: Crossfoot of: 7364 is 7+3+6+4=20=2+0=2:
    Crossfoot of: 7364 is = 2

    I hope you all like it and can use it in SRL maybe under math??

    Here we go...
    SCAR Code:
    Function Crossfoot(s:String):Integer;
    var
      PlaceInString, FinalResult, Lengt : Integer;
      TempString : String;
    Begin
    Lengt := Length(s);
    repeat
    PlaceInString := 0;
    FinalResult := 0;
      repeat
        PlaceInString := PlaceInString+1;
        TempString := copy(s, PlaceInString, 1);
        FinalResult := StrToInt(TempString)+FinalResult;
        Lengt := Lengt-1;
      until (Lengt = 0);
      Lengt := Length(IntToStr(FinalResult));
      s := IntToStr(FinalResult);
    until (Lengt = 1);
    Result := FinalResult;
    End;

    Hope it works for you it work for me...
    If you find any errors please post it here

    \\Batnas
    My first script!!!
    http://www.srl-forums.com/forum/show...tupost&t=32388

    There are 10 kind of people in the word
    -Those who can the binary
    -And those who can't

    http://www.srl-forums.com/forum/diff...ls-t30279.html

    http://www.srl-forums.com/forum/tut-...radial+walking

  2. #2
    Join Date
    Jul 2007
    Location
    Players[CurrentPlayer].Loc:='Bank'
    Posts
    875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What would be a use for this? Other than existing, what could it be used for?
    Quote Originally Posted by sirlaughsalot
    .... Obama had the devil jump out of his ass, run and stab Hillary in the back...
    ILMMTYAEAFHPY.

  3. #3
    Join Date
    Mar 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I cant remember right now what i should use it for...
    But anyway it was very funny to make it

    Please some feedback if anyone of you out there try it

    \\Batnas
    My first script!!!
    http://www.srl-forums.com/forum/show...tupost&t=32388

    There are 10 kind of people in the word
    -Those who can the binary
    -And those who can't

    http://www.srl-forums.com/forum/diff...ls-t30279.html

    http://www.srl-forums.com/forum/tut-...radial+walking

  4. #4
    Join Date
    Jul 2007
    Posts
    217
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could use it as a random password generator. type in a random number, get the cross thingy, and over and over until you has a password.

  5. #5
    Join Date
    Mar 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    he he nice!
    thats what i should have used it for
    now i can make an ultra random password maker ;|

    \\Batnas
    My first script!!!
    http://www.srl-forums.com/forum/show...tupost&t=32388

    There are 10 kind of people in the word
    -Those who can the binary
    -And those who can't

    http://www.srl-forums.com/forum/diff...ls-t30279.html

    http://www.srl-forums.com/forum/tut-...radial+walking

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    There already is an ultra random password maker and I don't understand how you could make a password from it as it outputs a number... So, with that use gone, is there really any other?
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  7. #7
    Join Date
    Mar 2008
    Location
    Indiana
    Posts
    192
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Improved?

    SCAR Code:
    function Crossfoot(Num: integer): integer;
    var
      Place, Len : integer;
      NumStr: string;
    begin
      NumStr := IntToStr(Num);
      Len := Length(NumStr);
      while (Len > 1) do
       begin
        DecEx(Place, Place);
        DecEx(Result, Result);
        while (Len > 0) do
         begin
          Inc(Place);
          IncEx(Result, StrToInt(copy(NumStr, Place, 1)));
          Dec(Len);
         end;
        Len := Length(IntToStr(Result));
        NumStr := IntToStr(Result);
       end;
    end;

    Lol it makes it look complicated

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •