Page 1 of 2 12 LastLast
Results 1 to 10 of 12
Like Tree5Likes

Thread: T11Formation.py - socialize your formation

  1. #1
    Dreamer
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Posts
    390

    T11Formation.py - socialize your formation

    Hi everyone,

    I want to share this python script (on GitHub) with everyone for free: T11Formation.py. This is a tool to take a formation name like 4-1-2-2w-1 and output a fancy string:

    DL--------AML---
    DC-----MC-------
    ---DMC--------ST
    DC-----MC-------
    DR--------AMR---


    This project is new, and ideas are welcome. Be sure to read the documentation on GitHub as well as here.

    There are a few things you need to know
    • You need python, because it is written in python. Don't worry, you only need to download this once. (Unless you want to update it, which is totally up to you.)
    • There is no graphical interface currently. You'll need to bring up a command window, navigate to where-ever you have the T11Formation.py file located and call it there.
    • There are a few rules when inputting your formation name:
      1. You must input all five rows starting with defense (i.e. a 4-4-2 needs to be input as 4-0-4-0-2).
      2. Rows with 2 or 3 players are narrow by default. To make a row wide add a 'w' at the end. (i.e a 4-5V-1 needs to be input as 4-1-2-2W-1).
      3. There is no error checking if you input more or less than 10 fielded players, this is up to you!
    • When you post your formation here it will use the default font. This is fine, but it won't line up great like it did in the output. To fix this post your formation with font tags using Lucida Console.


    The script can also be used as a python module! This includes other functionality that I won't mention here as it's already on GitHub. At some point I want the script to have access to all the under-laying functionality. Contributors welcome! If you'd like to contribute either get in contact with me and I'll add you or create a pull request.

    Now that everything is out of the way, I'd like to give some examples!

    3-2-2-2-1 B-fly (3-2w-2-2w-1):
    ---DML----AML---
    DC-----MC-------
    DC------------ST
    DC-----MC-------
    ---DMR----AMR---


    4-4D-2 wide (4-1-2W-1-2):
    DL-----ML-------
    DC------------ST
    ---DMC----AMC---
    DC------------ST
    DR-----MR-------


    3-2-3-2 (3-2W-3-0-2):
    ---DML----------
    DC-----MC-----ST
    DC-----MC-------
    DC-----MC-----ST
    ---DMR----------


    I hope someone finds this tool useful!

    P.S. The CODE tag does not prevent a FONT tag from being translated in preview
    Manager of Foresters FC and Guide FC. Both teams on server '161'.

    Wondering if I took the time to type out that fancy formation? Nah, check out my python script!

  2. #2
    English Forum Moderator Cat Harrison's Avatar
    Join Date
    May 2013
    Location
    StL
    Posts
    8,062
    Or any other fixed width font.

    It's neat!
    Last edited by Cat Harrison; 08-20-2014 at 11:35 PM.
    Expressed above is my own opinion. Your results may vary.
    ▬ ▬ ▬▬ ▬ ▬▬ ▬ >BvB
    < ▬ ▬▬ ▬ ▬▬ ▬ ▬
    [SIGPIC][/SIGPIC]

  3. #3
    Dreamer
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Posts
    390
    Thanks Cat!

    If you try out the tool, Please provide as much feedback as possible! Reasonable ideas for improvement are welcome too!
    Last edited by Cody Allan Taylor; 08-21-2014 at 05:23 PM.
    Manager of Foresters FC and Guide FC. Both teams on server '161'.

    Wondering if I took the time to type out that fancy formation? Nah, check out my python script!

  4. #4
    Apprentice jacks's Avatar
    Join Date
    Jul 2014
    Posts
    250
    Can you code this with .php?

  5. #5
    Dreamer
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Posts
    390
    Quote Originally Posted by jacks View Post
    Can you code this with .php?
    Any particular reason? If you just want something you can embed, I could always code up a python http response.
    Manager of Foresters FC and Guide FC. Both teams on server '161'.

    Wondering if I took the time to type out that fancy formation? Nah, check out my python script!

  6. #6
    FCB
    FCB is offline
    Famous FCB's Avatar
    Join Date
    May 2013
    Location
    India
    Posts
    1,884
    good one buddy
    Cody Allan Taylor likes this.
    FCB - Indian Team

    Playing form 2013

  7. #7
    Newbie
    Join Date
    Aug 2014
    Posts
    18
    can somebody make tutorial how to use it? please i dont understand where to download t11 formation and where to download it?!

  8. #8
    Dreamer
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Posts
    390
    Quote Originally Posted by Benjamin Jagurdzija View Post
    can somebody make tutorial how to use it? please i dont understand where to download t11 formation and where to download it?!
    1. Go to the GitHub
    2. Clink on Download Zip on the right side
    3. Save the zip file where you intend to use it and extract it


    1. Run "python T11Formation.py [FORMATION-TITLE]" in your command line
    2. Copy the output text (in windows right on the windows and hit "mark", then select the output and hit enter. That will place it in your clipboard)
    3. Paste into your reply box, select it, and choose a fixed width font (Lucinda Console looks decent)
    Manager of Foresters FC and Guide FC. Both teams on server '161'.

    Wondering if I took the time to type out that fancy formation? Nah, check out my python script!

  9. #9
    Apprentice jacks's Avatar
    Join Date
    Jul 2014
    Posts
    250
    The whole algorithm of this is just reading numbers and after that write "dl---dc---dc---dr" for example if the first number is 4. Not everyone will download or run this on their hardware (maybe theyre using only mobile phones) thats why im asking about php script .

    Ps. If you can add to this new feature that can say if the formation is legal or not that would be great I can help. For this you need to check if the score of last 3 numbers < 4 then write "formation is illegal"(because formations like this are not legal 4-3-0-2-1), if there is no 4 number detected or 2w or 3w (for example 3-3-0-1-3) then writte "formation is illegal"(because you need atleast 2 players on the flanks) and the last one if in entered numbers are found 3 times things 4, 2w and 3w then write "formation is illegal"(because you can't play with 3 players on the flanks).
    Last edited by jacks; 08-25-2014 at 05:05 PM.

  10. #10
    Dreamer
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Posts
    390
    Quote Originally Posted by jacks View Post
    The whole algorithm of this is just reading numbers and after that write "dl---dc---dc---dr" for example if the first number is 4. Not everyone will download or run this on their hardware (maybe theyre using only mobile phones) thats why im asking about php script .

    Ps. If you can add to this new feature that can say if the formation is legal or not that would be great I can help. For this you need to check if the score of last 3 numbers < 4 then write "formation is illegal"(because formations like this are not legal 4-3-0-2-1), if there is no 4 number detected or 2w or 3w (for example 3-3-0-1-3) then writte "formation is illegal"(because you need atleast 2 players on the flanks) and the last one if in entered numbers are found 3 times things 4, 2w and 3w then write "formation is illegal"(because you can't play with 3 players on the flanks).
    I do actually have an "is_legal" method in the class. I'm just not sure how I want to add it to the input/output.

    As for the simplicity of it, that's pretty intentional. I want to make it a community tool, so I kept it as simple as possible to make it easier to add features later.

    Now that I've had time to think about it I fully intend to make a HTTP response script so that you could easily embed it. I'm going to do some testing in Java because I want to refresh my servlet knowledge anyway.
    Manager of Foresters FC and Guide FC. Both teams on server '161'.

    Wondering if I took the time to type out that fancy formation? Nah, check out my python script!

Page 1 of 2 12 LastLast