Total lines cleared?

Thread in 'Discussion' started by kury, 22 Dec 2008.

  1. kury

    kury Unregistered

    Alright, I've been looking around for a specific feature for a while now, but without much luck, so I thought I'd ask for help here. I'm simply looking for a preferably decent tetris game on pc or consoles (except new gen and psp, ds is fine) that keeps track of the total number of lines you cleared from all your playing sessions. I've tried what seems to be the most popular games around here and I didn't find any that had this, though they nearly all had statistics for each individual session, which I'm not too interested in.
    So far the only game I've seen that has this feature at all is The New Tetris, on n64. I would be content with that, except I'm really not a fan of the whole silver/golden squares concept. So I'm looking for an alternative, but if there's really nothing else then I'll have to settle with this.

    So please, does anyone knows a game that has that?
     
  2. Tetris DX for Gameboy Color keeps track of your total lines. I have over 40,000 lines on that cart.
     
  3. Amnesia

    Amnesia Piece of Cake

    hi and welcome here kury !

    It is true that even if the TGM serie proposes some very accurate Tetris games, they don't keep any stats about the number of line..
    (that doesn't prevent me to hope that if you stay around here a moment, you will forget this story of line trust me.. [​IMG] )

    Anyway, Heboris is the best alternative I suggest, it emulates every main games who exist, marathon style, time attack, sprint..etc.
    You can profite of every rotation systems which exist in the world of tetris, and the game allow you to easily record every of your game automatically.
    You can have the accurate grading system of TGM, AND offcourse, the number of lines is displayed and archived with your replays.

    you can also use Lockjaw.
    Lockjaw is a very epured Tetris game enterily customisable, and he records every stats you need in a text file..With the number of line included.
     
  4. tepples

    tepples Lockjaw developer

    True, the PC and DS versions of Lockjaw save the number of lines cleared in each round to lj-scores.txt. You'd just need to write a simple postprocessor in Perl, Python, etc. to add up the lines. Can you handle it, or should I?
     
  5. kury

    kury Unregistered

    Thanks for the reply!

    From my experience, I think heboris would be the best choice for me. But, from what I understand, it only tells you the lines from each individual game you've played. I can deal with that if I have to, but I would much rather have a game that addition all your lines ever by itself. So if heboris is in fact like this, I'll pick Lockjaw instead.

    I have no knowledge in programming whatsoever, so it'd be great if you could do this for me, tepples. A little question, too. Are the DS and PC versions compatible for eachother? As in, do they use the same file structure so I could transfer my options and stats from pc to ds back and forth? I assume the ds version uses no file whatsoever other than the rom and save, but I'm probably wrong.
     
  6. m:)

    m:) Unregistered

    kinda like a tetris odometer
     
  7. tepples

    tepples Lockjaw developer

    The DS version writes to /data/lockjaw/lj-scores.txt, which is in the same format as the lj-scores.txt written by the PC version. The GBA version doesn't track scores.
     
  8. kury

    kury Unregistered

    Alright, that's great to know. Well if you don't mind, could you please provide a quick way to add all the lines from lj-scores.txt? I have no idea how to do this myself. You could also add it to any future version of lj if you think others may benefit from it, maybe?

    I've been messing around a bit with lockjaw now and I'm starting to like it more and more, so I'll be staying with this instead of heboris.
     
  9. tepples

    tepples Lockjaw developer

    This program is written in Python 2 and has been tested on a PC running Windows XP. Install Python, paste the code into a new file called lj-scores.py, and run the program.
    Code:
    import re
    
    lineCountRE = 'Made ([0-9]*) line'
    lineCountRE = re.compile(lineCountRE)
    totalLines = 0
    
    def analyze(f):
      "Get total line count from an FLO formatted like Lockjaw lj-scores.txt."
      totalLines = 0
      for line in f:
        match = lineCountRE.search(line)
        if match is not None:
          lines = int(match.group(1))
          totalLines += lines
      return totalLines
      
    infp = None
    try:
      infp = open("lj-scores.txt", "rU")
      totalLines = analyze(infp)
    except IOError, e:
      print "Could not read from lj-scores.txt"
      print e
    else:
      print "total lines:", totalLines
    finally:
      if infp is not None:
        infp.close()
    
     
  10. kury

    kury Unregistered

    This works perfectly! Thanks a lot for your time and help (:
     
  11. Amnesia

    Amnesia Piece of Cake

    when I read something like that, I mean, the little code of tepple, I really feel myself handicaped..
    It is almost as horrible for me as the chinese is..
    I can follow the program thanks to the 20 hours of lesson I got about the C language in my school, but I will never be able to write such a program..
     
  12. Muf

    Muf

    I used to feel like that as well, a couple of years ago. Telling yourself you can't program is very unproductive; my best advice is to just pick something you want to do, and start working on it, making mistakes as you go.
     
  13. or if you're on mac or linux, the following does the trick:

    Code:
    awk '$0~/Made ([0-9]*) line/ {x = x + $2} END {print x}' lj-scores.txt
     

Share This Page