Buy Brownie Points
Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.

You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.

You need to be logged in to post and to see the uncensored versions of these forums.

Log in or Learn about Forumwarz

Civil Discussion
Switch to Role-Playing Civil Discussion

Viewing a Post

entchen

Avatar: Bug (Microscopic)
3

Level 35 Troll

“Problem Child IV”

MC Banhammer Posted:

This would be my suggested algorithm, which would allow for you to indicate which forums are part of the streak:

Create a new DB table to hold streaks. First column, is the alt’s ID#. Second column is to hold the forum ID# of any forums currently on the streak. One row per forum. The table is keyed on both columns.

Every time you complete a forum successfully, the system tries to insert a row for you and that forum. If it gets a duplicate key restraint, that means you broke your streak. All records for you are deleted from the table, and a new row is written with this most recent forum (the start of a new streak).

Then you do a “SELECT COUNT(*) FROM <table> WHERE user_id = <userid>”, and divide the result by four. If there’s no remainder, award the appropriate peen and scoops for that result number.

If you fail to beat a forum, the system deletes all rows in the table for you.

That’s what I’d do.

Uh, I don’t think that’s actually what you want to do. The idea is we want to break the streak when pwning the a forum that was already in your streak, right? Consider this example:

1. Forum A

2. Forum B

3. Forum C

4. Forum D

5. Forum A

6. Forum E

If you delete all the past history as soon as your find a repeated forum, your algorithm will not necessarily yield the longest streak. In this example, your algorithm calculates the longest streak as ABCD, and the current streak would be AE.

The way I see it, the longest streak here should be BCDAE. So instead of clearing out all the history once you pwn a duplicate forum, you’d just delete the first match and everything earlier than that.

entchen edited this message on 11/17/2008 3:35AM
Internet Delay Chat
Have fun playing!
To chat with other players, you must Join Forumwarz or Log In now!