Our members are dedicated to PASSION and PURPOSE without drama!

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - VLS

#251
Bet selection:

- Track all the numbers until there is only one number unhit.

- Wait until that number is spun.

- Use that number as a target number for the parachute.

- When on the lines/quads/split, always back the location most recently spun among those containing the target number.

Progression (in risk):

36-unit parachute: http://betselection.cc/mixed/36-unit-parachute/
#252
Straight-up / The Fortress System
January 14, 2013, 11:29:03 AM
Translation:

According to probability theory, a number must come once every 37 or 38 spins (on average) depending on the type of roulette. This, as we know, is virtually impossible to happen in a brief sequence of spins, therefore it's only normal that more than 1 number repeats within a sequence of 37 or 38 spins.

Likewise, we can say that beyond the existence of 2-time shows (repeats), there are 3-time shows within this brief sequence, which is absolutely normal. The abnormal would be for this not to happen.

So far, so good. Based on this principle, the Fortress is based on waiting for the numbers that repeat within a sequence and bet only on them.

You must bet straight-up only on number which have repeated once, spin after spin, until one of them repeats again and generates a positive balance in chips. Once this target win has been achieved, a new sequence is started without considering the repetition from the previous sequence.

Let's see the following example:

17, 2, 00, 29, 19, 26, 23, 24, 11, 10, 36, 35, 5, 28, 7, 28, 33, 10, 5, 13, 9, 13, 17, 19, 5, 2, 26, 16, 25, 35, 6, 35, 10, 3, 31, 36, 34, 1, 8, 4, 14, 34, 14, 36, 7, 11, 34

The first number to repeat is 28 (highlighted in red), then you start to bet on it straight-up, spin after spin. Then the following numbers repeat: 10, 5, 13, 17 and 19, then 5 repeats again (highlighted in blue).

Until then we were betting straight-up on 28, 10, 50, 13, 17 and 19. Making a general balance there's a net gain of +8 chips.

In case that the second repetition would have lasted more spins to appear, you must be careful to plan your wagered amount on each number, so the hit from the winning spin compensates the losses from the previous ones.

After the winning spin you start again from scratch in a new sequence, absolutely independent from the past one, which has its winning spin on number 34, to get a net gain of +9 chips.
#253
Straight-up / Humble but Real
January 14, 2013, 11:26:11 AM
Author: Claudio 03

Translation:
 
The system is simple and looks silly but anyone who has statistics could verify it.

It is the anti-game to the fortress system.

You start a series and as soon as the first numbers doubles (in average between the 8th and 10th spin) play its two neighbors, without betting the number which doubled, writing -2 if you don't hit. You keep on betting, writing -2 per spin until the second number doubles. From this point on, you play 4 units per spins; 2 neighbors from the first doubled number and 2 from the second. Keep on betting until reaching -36 chips.

If you reach -36 (in case you don't hit fast within 9 or 10 spins), start a fresh series again, waiting for the first number to double in order to repeat the operation.

If you hit, then you start again too.

In average the session with a hit should double the sessions with losses, since you would win an average of 18 chips for each 36 lost when there is no game.

The curious thing is that this mathematical relationship of 2-1 isn't like that in the reality of the game and favors us in a 3 and 4 to 1.

It looks incredible, yet when a number doubles, the ball looks for that same number again, but since the 2-shows predominate over the 3-shows by far, the neighbors of those numbers which doubled are going to come up, and what is worth is the very short term. Because of that I don't care for the game to last few spins since the roulette game is one of such very short streaks (I REPEAT, DO NOT HUNT THE REPEATING NUMBERS).

The only problem we have with this system is the "hole" which is the hot number and which is going to make us mad when it triples and the ball goes right in between the numbers we bet; but don't get nervous; in a longer space in the monthly balance, we are going to have a benefit in favor. Between 400 to 1000 chips.

Play sessions of 108 spins preferably. This should demand approximately 3 hours and a half from us.

Example:

I start the session: 4 . 10 . 5 . 28 . 17 . 10.

Number 10 doubles. I start to bet one chip on 23 and one chip on 5 (its two neighbors)

2 chips per spin.

Then it comes 25 . 36 . 7 . 4

Now 4 doubles too, then I add numbers 19 and 21. One chips on each.

The total of numbers played until now is 4 per spin. I have a count on the side that comprehends from the point I start betting 23 and 5. Each spin I miss -2 + -2 + -2 + -2 until number 4 doubles (I have -8 lost units) then I use -4 for adding to the count. When I reach -36 missing chips, I call the session as ending and start a new number series, repeating the aforementioned procedure and WITHOUT THE USE OF ANY PROGRESSION... this point is of utmost importance.

Bad days with this method are hard to find, but they are there. It would be a true shame that the cumulative earnings were taken by the casino in only one bad day just because of our stubborness of wanting to win every day.

I repeat, let's learn to accept such losses and we will learn to WIN.

Greetings

Claudio 03
#254
Meta-selection / "10:1" RESET POINT Rule
January 14, 2013, 11:16:03 AM
This is another way to protect the bankroll. It goes like this:

For every 10 units drawdown, reset point gets decremented -1.

Example:

Using a 100-unit bank, if it happens that some bets are lost and bank gets to 90, then the reset/exit point is decremented in -1 from 100 to 99.

Shall I have a hit and get the bank to 99, then it is time to reset the "attack". This helps in preventing that for not cutting the cycle in 1 unit, it goes lost.
________________

So, considering the 100-unit bank, it goes like this:

Bank's lowest  / Drawdown / Units decremented by 10:1 rule / New reset point
90 / 10 / -1 / 99
80 / 20 / -2 / 98
70 / 30 / -3 / 97
60 / 40 / -4 / 96
50 / 50 / -5 / 95
40 / 60 / -6 / 94
30 / 70 / -7 / 93
20 / 80 / -8 / 92
10 / 90 / -9 / 91

Regards,
Victor
#255
People usually think of positive progressions as a "Hit it big" sort of scheme, but they can also fit a recovery strategy perfectly.

Time ago I was discussing a reversed Fibonacci with fellow forumer "Toby"; he made it clear it may not be necessary to hit the table limit to get up, only to be in profit.

It is quite a valid point indeed, and one I think conscious players would eventually come to realize.

Those upward "spikes" in the bankroll balance created by the power of positive progressions, with CASINO's money, can perfectly suit a smart player's exit strategy.

I know, I know... That pesky internal gambling bug is saying: "The next bets could be the big winners" and "better to find out how much ca$h can be raked-in"... but it is up to the player to use a more conscious approach than a plain "all in" for the next spin; think along the lines of a 50% increase instead of a full, 100% all or nothing stake.

It is important to keep as well as to make.

Remember; winners know both: when to push, and when to draw.

The next time you are using a positive progression instead of going "for the win", trying to reach the stars and breaking down the house, remember this advice and go "for the recovery" instead.

Paraphrasing the words of a good ol' friend of mine: it's not what you make at the table, but what you keep to your home what adds-up.

Cheers!
Vic
#256
Dozen/Column / Dozen/Column march: Break-Even Point
January 14, 2013, 10:54:02 AM
 Break-Even Point March. It obeys the reason of betting two opposite events(Dozen repetition and Non repetition) alternatively. Which flat betting usually have the tendency to float up and down, in cycles, making it an option for a placeholder bet without rising the unit, or by the addition of a positive progression, a nice candidate for grinding some profits in regular sessions of play.



March's procedure:

A:When a dozen repeats, play the last spun dozen hunting "Dozen repetition" event, for 3 spins. Moving from dozen to dozen as they are spun.

B:If after 3 spins there is no dozen repetition, then switch to betting againstthe "Dozen repetition" event, by playing the other 2 dozens, uncovering last dozen spun.

When a dozen repeats, go back to A. this is a "loop", or better expresed, a March.

Zeroes aren't reacted to. When a zero appears, bet selection continues as usual, even as the bet is lost.



Ok, what use might a "Break Even" march have other than a placeholder bet? Well... adding a positive progression the charts tend to go upwards, enough to wrap a strategy around it.

I have used the pluscoup positive progression along with this and had good results.

i.e. this:

[attach=2]

Best regards,
Victor
#257
Money Management / 50% Money Management
January 14, 2013, 10:45:41 AM
Lucky Strike made this question: "When is your money your money?" I did have at a point to answer that myself many moons ago; how much to keep for my personal (and familiar) expenses, how much to re-invest? Answer = a good round number is 50%.

Let me explain my take on the 50% Money Management from scratch with 3 starting banks as lifetime-bankroll:

[attachimg=1]

This is the main scheme: To explode as much as possible 1st bank's unit value and to create as many minimum-value banks to act as "cushion" between you and the casino as you can make. The more banks the better because in gambling having available bankrolls to play is life itself.

If you are playing you'd want to own the profits as soon as you finish your session, but also your stack of banks needs to grow. Under the 50% framework, after a winning session you split the 100% won amount like this:

[attachimg=2]

50% to you, the person playing and 50% to re-invest.

The re-invested 50% amount is again split in half (25% + 25%) and distributed equally to increase the unit value at the 1st bank you want to Explode in the $$$ value and to help in the creation of new banks to serve as more cushion between you and the casino.

__________________

As you have a successful inter-session winning streak (several sessions won in a row) you grow the unit value at the first bank, and this triggers more actual money for you to have your 50% cut with each session, increases more rapidly the number of minimum-value unit banks as "cushion" and also enters in a positive loop by re-increasing 1st bank's $$$ value per unit.

[attachimg=4]


If you hit a bad inter-session streak (several concatenated sessions lost) after losing the first bank, a minimum-unit value bank is taken from reserve and you give back / lose the least $$$ possible as the value is returned the minimum again.

[attachimg=3]




Please remember the more fragmented the unit the better. If you play for instance the dozens with 1 unit = 10 chips, you can enjoy rising in decimals like this: 10.1 = 11 chips placed on the dozen. 10.3 = 13 chips placed, etc. when using "solid" units ( 1 unit = 1 chip ) this is not available.

And of course, feel free to use this Money Management scheme with the system that suits you better.

Hope it helps.

Best regards from your friend,
Victor
#258
General Discussion / Online List Color key
January 08, 2013, 02:13:47 AM
This is our current color key for online members:


[attachimg=1]
#259
Mixed / AAO (Against All Odds) from GG's archives
January 07, 2013, 06:32:55 PM
Author: TurboGenius
Topic: AAO-2007
Posted: 18-Aug-07 09:47

Used and abused at the casino and works very well.

*Bago disclaimer : this is not a holy grail, it will fail long term.
Do not risk money that you cannot afford to lose...
*end of disclaimer*
==============================================

AAO (Against All Odds) was a method that goes from location to locati
on - from the outside to the inside in an attempt to profit.
Some changes I've made since it was posted improve it slightly.
Instead - now I'm looking at finding a "temporary" hot location and
sticking with it, allowing the winnings to make up for the losing
spins from other locations.

Simple explanation :

Let's break the table down into sections, none of which are part of o
ne another :

Dozen 1 / 12 numbers
Line (13-18) / 6 numbers
corner (19/20/22/23) / 4 numbers
street (25/26/27) / 3 numbers
split (28/29) / 2 numbers
straight up 30 / 1 number

for a total 28 numbers covered during the progression.

Now - you can run off any number of spins and see that it is very ver
y rare to have each of these locations showing at - standard deviation
.

For example, I'll run 1,000 spins and post the results of each locati
on below.

Dozen 1 / +0.49 std dev
Line (13-18) / -1.55 std dev
corner (19/20/22/23) / +0.39 std dev
street (25/26/27) / +0.12 std dev
split (28/29) / +1.33 std dev
straight up 30 / +0.73 std dev

So, there are obviously profitable sections to play and not so
profitable ones  The key is getting off of the bad ones and staying
on the good ones to make profit during the progression.

==========================================

How it's played :

Allow each section to run through it's "expected" number of
spins to show. If it doesn't - then move on to the next.
But if it does, stay on it until either profit is made, or
it goes to the end and you need to move locations again.

How many spins for each location ?

Dozen (3 spins)
Line (6 spins)
Corner (9 spins)
Street (12 spins)
Split (18 spins)
Straight up (36 spins) <yes you could use 37 or 38.

==================================================

Progression is a simple +1 unit per move from location to
location.

Dozen = 1 unit each spin
Line = 2 units each spin
Corner = 3 units each spin
Street = 4 units each spin
Split = 5 units each spin
Straight up = 6 units each spin.

==================================================

Example of play :

note, we are on dozen 1 most of the time unless the
progression is needed.
5.00 chip used as a "unit"

spin...location...units used...win/loss...balance
1...dozen...1...win...+10
2...dozen...1...loss...+5
3...dozen...1...win...+15
4...dozen...1...win...+25
(note : dozen 1 is doing great and we are playing it - that's
the purpose of the method)
5...dozen...1...loss...+20
6...dozen...1...loss...+15
7...dozen...1...loss...+10
(note : 3 losses for the dozen so we move on)
8...line...2...loss...0
9...line...2...loss...-10
10...line...2...loss...-20
11...line...2...win...+30
(note: profit reached so we move back to the dozen)
12...dozen...1...loss...+25
13...dozen...1...loss...+20
14...dozen...1...loss...+15 (move)
15...line...2...loss...+5
16...line...2...loss...-5
17...line...2...loss...-15
18...line...2...loss...-25
19...line...2...loss...-35
20...line...2...loss...-45 (6 loss / move)
21...corner...3...loss...-60
22...corner...3...win...+60
(note: profit reached so we move back to the dozen)
23...dozen...1...etc

You should have the jist of it now.

Now, let's assume that the corner went 6 or so spins
and then showed up. The win wouldn't have been enough to
make profit - but as long as it won within 9 spins, we
stay on it at the same chip size and continue.

=======================================

What happens is - and it may take a while sometimes -
You end up on a location that is hitting above expected
and the multiple wins will pull the balance back up to
profit.
#260
Meta-selection / Roulette is a Short-Circuited game
January 07, 2013, 06:19:44 PM
Roulette is a Short-Circuited game on which AT ALL TIMES something is happening.

When your bet selection isn\'t in the spotlight, it means something else is.

Be clever. Have several (preferably opposite) events and adapt to whatever pattern/event/tendency is currently at present.

If you can\'t find an extant trend in this short-circuited game, then you need to fine-tune your strategy until every spin is playable, because you must have enough range in your triggers to spot what\'s presently \"on\" in any set of actuals.

Remember: \"Every set of actuals bears its own winning method\" -It\'s our duty to have our triggers sharp and our eyes wide open to match it out.

Vic
#261
Meta-selection / The foundations for a WINNER
January 07, 2013, 05:07:33 PM
It is my personal belief a long-term winner needs to be harvested from the short term. The long term is -after all- only the net concatenation of many shorter terms. If you focus in beating these shorter spans/frames and succeed, you beat the long term, without even worrying about it.

Foundations to this task:
1) Must be adaptative.

Over the years, the accepted conclusion is there is simply no stiff bet you can plug-in and beat the game.

The only thing that is accepted -even by the casinos- is there are winning time-frames for punters.

If you would have a way to identify and back those lucky punters' bets when they are having their winning run, you could sum 'em all. Likewise, you could substitute "punter" for "bet/method/trigger" in order to make the same. Nobody is putting a gun in your head for you to lose it all stiffly with one single trigger. You have the ability to stop and re-evaluate current conditions.

2) It must be a STRATEGY, comprehending several bet/triggers.

No single trigger can work.

The best trigger for your time-line strategy gets to be the one that clumps the most.

This enables you to identify such bets the easiest.

When they aren't getting hits at the rate probability would dictate for the current cycle, you disable them and put them to sleep for as long as they wish to be a sleeper. On the other hand, when your monitored bet is having one of its good runs at the expected rate for the cycle or better, you stick to it and leech it for everything it's worth.

3) Money management must be focused on bankroll preservation AND bankroll compounding at the same time.

Your money management must have two modes:

1) First mode should be oriented to bankroll preservation.

After a losing session you should ideally reduce your unit to the minimal/base unit available, in order to let evening-out concatenated bad sessions take the least in actual chip value.

2) Second mode, after a winning session, must be oriented to BANKROLL COMPOUNDING.

Your aim needs to be to lose pennies on concatenated bad times and win dollars, fivers and as much as possible in concatenated good sessions.

Even as the game "matches" your net units to the expected rate, the management of your unit value according to negative and positive trams needs to give you a remainder after the base raw units (in number) get evened-out. Remember the wheel and the felt are inanimate objects and don't communicate. The wheel doesn't know anything about how much is there of the felt on any place. The raw unit numbers are scheduled to even-out, but the VALUE of those units in the positive and negative trams is completely up to you. They don't need to be static. You can use this to your benefit.

Lose less when losing and win more when winning, in a practical way.
#262
General Discussion / Incomplete Image for you?
January 06, 2013, 03:05:13 PM
There are two images in the opening message in this topic:


http://betselection.cc/general-discussion/hitting-at-a-200-odds-bet/


Can you see the BetVoyager table in full? How about the betvoyager balance one?

Thank you.
#263
Mixed / Has anybody compounded NEGATIVE progressions?
January 01, 2013, 02:43:34 AM
We're always used to compounding in the positive progression sense, but recently I've been bugged by negative-progression compounding.

What I mean is:

- Using large "divisible" units (at least divisible by 10)

- Using negative progressions such as the Grand Martingale.

- Re-investing units earned to grow the base unit in order to derive larger net returns on the positive runs, while keeping the bad runs losing units at the regular (not inflated) rate.

I know the long term is against, but we can make MM schemes such as to last longer under "regular" game conditions, and/or use it as part of other strategies (i.e. acting as very defined recovery for another method).




Before embarking in such exploration myself, just wanted to tread the waters for previous work -if any.


Anyone? :)
#264
General Discussion / Happy New Year 2013!!
December 31, 2012, 10:04:42 AM
For every member, as it happens in all Time-zones.

Receive a Happy New Year 2013 from your forum family @ BetSelection.cc

May this year bring in fruition to your most worthy goals.



:rose: :love: :rose:
Victor & Family
#265
General Discussion / Recent forum issues for you?
December 31, 2012, 12:12:03 AM
Are you guys experiencing any weird behavior by the forum software?

Some days ago there was a new mandatory patch applied. If you happened to experience something odd, please report.

Here's hoping it isn't a matter of a whole re-install from scratch. Ideally we can work it out.

We do care. Thank you.
Vic
#266
General Discussion / Ideas for site exposure?
December 28, 2012, 03:42:29 PM
What ideas can you give to give our site more exposure to reach more visitors?


We're open in here to your ideas :)



#268
Archive / [RC] LastXSplits Release Candidate 1
December 26, 2012, 06:58:44 PM
Feature-complete release!

Download executable (.exe) file: [attachmini=2]

[attachimg=1]
If any tester could confirm it works in full on his/her system we can proceed to make it an official release :nod: :thumbsup:

This code-base gets to be forked into Last X numbers, last X streets, last X lines, last X quads...

Just need confirmation by fellow testers all features are usable.

Source:

Code (csharp) Select
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Xml.XPath;


namespace LastXSplits_0_1
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public Form1()
        {
            // Initialization
            InitializeComponent();
        }


        // History implemented as stack (LIFO)
        Stack<int> history = new Stack<int>();


        // Redo implemented as stack too
        Stack<int> redo = new Stack<int>();


        // Splits as List of Split class
        List<Split> Splits = new List<Split>() { new Split(1, 0), new Split(2, 0), new Split(3, 0), new Split(1, 2), new Split(1, 4), new Split(2, 3), new Split(2, 5), new Split(3, 6), new Split(4, 5), new Split(4, 7), new Split(5, 6), new Split(5,, new Split(6, 9), new Split(7,, new Split(7, 10), new Split(8, 9), new Split(8, 11), new Split(9, 12), new Split(10, 11), new Split(10, 13), new Split(11, 12), new Split(11, 14), new Split(12, 15), new Split(13, 14), new Split(13, 16), new Split(14, 15), new Split(14, 17), new Split(15, 18), new Split(16, 17), new Split(16, 19), new Split(17, 18), new Split(17, 20), new Split(18, 21), new Split(19, 20), new Split(19, 22), new Split(20, 21), new Split(20, 23), new Split(21, 24), new Split(22, 23), new Split(22, 25), new Split(23, 24), new Split(23, 26), new Split(24, 27), new Split(25, 26), new Split(25, 28), new Split(26, 27), new Split(26, 29), new Split(27, 30), new Split(28, 29), new Split(28, 31), new Split(29, 30), new Split(29, 32), new Split(30, 33), new Split(31, 32), new Split(31, 34), new Split(32, 33), new Split(32, 35), new Split(33, 36), new Split(34, 35), new Split(35, 36) };


        // Counter as BindingList of SplitCount (bound to DataGridView in FormCount)
        BindingList<SplitCount> Counter = new BindingList<SplitCount>();


        // Instantiate history form
        Form fHistory = new FormHistory();


        // Instantiate counter form
        Form fCount = new FormCount();


        // Reference to DataGridView
        DataGridView dgvCount;


        // Reference to History ListBox
        ListBox lbHistory;


        // Global PictureBox Array
        PictureBox[] pbG;


        // XML settings Filename
        string xmlFile = Path.GetDirectoryName(Application.ExecutablePath) + "\\LastXSplits.xml";


        /// <summary>
        /// Program's entrypoint
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            // Declare control array
            PictureBox[] pbCtrl = { pb0, pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8, pb9, pb10, pb11, pb12, pb13, pb14, pb15, pb16, pb17, pb18, pb19, pb20, pb21, pb22, pb23, pb24, pb25, pb26, pb27, pb28, pb29, pb30, pb31, pb32, pb33, pb34, pb35, pb36 };


            // Assign references
            pbG = pbCtrl;


            // Attach events to each control
            foreach (PictureBox ctrl in pbCtrl)
            {
                // MouseLeave
                ctrl.MouseLeave += new EventHandler(PictureBox_MouseLeave);


                // MouseEnter
                ctrl.MouseEnter += new EventHandler(PictureBox_MouseEnter);


                // MouseDown
                ctrl.MouseDown += new MouseEventHandler(PictureBox_MouseDown);


                // MouseUp
                ctrl.MouseUp += new MouseEventHandler(PictureBox_MouseUp);


                // MouseClick
                ctrl.MouseClick += new MouseEventHandler(PictureBox_MouseClick);
            }


            // Set dgvCount
            dgvCount = (DataGridView)fCount.Controls["dgvCount"];


            // Prevent automatic generation of columns
            dgvCount.AutoGenerateColumns = false;


            // Add shows column
            DataGridViewTextBoxColumn showsColumn = new DataGridViewTextBoxColumn();
            showsColumn.DataPropertyName = "Shows";
            showsColumn.HeaderText = "Shows";
            showsColumn.Width = 50;
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            showsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            dgvCount.Columns.Add(showsColumn);


            // Add splits column
            DataGridViewTextBoxColumn splitsColumn = new DataGridViewTextBoxColumn();
            splitsColumn.DataPropertyName = "Splits";
            splitsColumn.HeaderText = "Splits";
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            splitsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            splitsColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgvCount.Columns.Add(splitsColumn);


            // Set dgvCount DataSource
            dgvCount.DataSource = Counter;


            // Set lbHistory
            lbHistory = (ListBox)fHistory.Controls["lbHistory"];


            // Show history form
            fHistory.Show();


            // Show counters form
            fCount.Show();


            // Check for XML file
            if (File.Exists(xmlFile))
            {
                // Set XPath Document               
                XPathDocument document = new XPathDocument(xmlFile);


                // Create XPath Navigator
                XPathNavigator navigator = document.CreateNavigator();


                // Process Options
                foreach (XPathNavigator section in navigator.Select("/LastXSplits/Options"))
                {
                    foreach (XPathNavigator node in section.SelectChildren(XPathNodeType.All))
                    {
                        // Toggle options
                        foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
                        {
                            // Set CheckState
                            if (tsmi.Name == node.Name + "ToolStripMenuItem")
                            {
                                // Load from file
                                tsmi.CheckState = (node.InnerXml == "Checked" ? CheckState.Checked : CheckState.Unchecked);
                            }
                        }
                    }
                }


                // Coordinates
                if (saveCoordinatesToolStripMenuItem.Checked)
                {
                    // Process
                    foreach (XPathNavigator section in navigator.Select("/LastXSplits/Coordinates"))
                    {
                        foreach (XPathNavigator subsection in section.SelectChildren(XPathNodeType.All))
                        {
                            // Process forms
                            foreach (Form frm in Application.OpenForms)
                            {
                                // Match
                                if (frm.Name == subsection.Name)
                                {
                                    // Set X,Y
                                    foreach (XPathNavigator node in subsection.SelectChildren(XPathNodeType.All))
                                    {
                                        // X
                                        if (node.Name == "x")
                                        {
                                            frm.Left = Convert.ToInt32(node.InnerXml);
                                        }


                                        // Y
                                        if (node.Name == "y")
                                        {
                                            frm.Top = Convert.ToInt32(node.InnerXml);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }


                // Last X value
                if (saveXToolStripMenuItem.Checked)
                {
                    // Set X
                    nudX.Value = Convert.ToInt32(navigator.SelectSingleNode("/LastXSplits/LastX/X").InnerXml);
                }
            }
            else
            {
                // Default options check state
                topmostToolStripMenuItem.Checked = true;
                saveCoordinatesToolStripMenuItem.Checked = true;
                saveXToolStripMenuItem.Checked = true;


                // Default "X"
                nudX.Value = 18;
            }
        }


        /// <summary>
        /// MouseEnter handler
        /// </summary>
        private void PictureBox_MouseEnter(object sender, System.EventArgs e)
        {
            // Show alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;
        }


        /// <summary>
        /// MouseLeave handler
        /// </summary>
        private void PictureBox_MouseLeave(object sender, System.EventArgs e)
        {
            // Remove image
            ((PictureBox)sender).BackgroundImage = null;
        }


        /// <summary>
        /// MouseDown Handler
        /// </summary>
        private void PictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            // Check for left button
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Change cursor to hand
                ((PictureBox)sender).Cursor = Cursors.Hand;


                // Show blue alpha-blended image
                ((PictureBox)sender).BackgroundImage = Properties.Resources.blue_highlight_alpha_38x47;
            }
        }


        /// <summary>
        /// MouseUp Handler
        /// </summary>
        private void PictureBox_MouseUp(object sender, MouseEventArgs e)
        {
            // Show yellow alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;


            // Change cursor back
            ((PictureBox)sender).Cursor = Cursors.Default;
        }


        /// <summary>
        /// MouseClick handler
        /// </summary>
        private void PictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            /* Right click = UNDO */


            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                // Check there's history
                if (history.Count > 0)
                {
                    // Pop last one
                    history.Pop();


                    // Remove from history ListBox
                    lbHistory.Items.RemoveAt(0);
                }


                // Disable if no history
                if (history.Count == 0)
                {
                    // Disable
                    disable();
                }


                // Update
                update();


                // Halt flow
                return;
            }


            // Check sender
            if (!(sender is PictureBox))
            {
                // Halt flow too
                return;
            }


            /* Left click = add to history */


            // Snip number
            int number = Convert.ToInt32(((PictureBox)sender).Name.ToString().Substring(2));


            // Push onto history stack
            history.Push(number);


            // Add to history ListBox
            lbHistory.Items.Insert(0, number);


            // Enable on first item
            if (history.Count == 1)
            {
                enable();
            }


            // Disable redo if manual input
            if (redo.Count > 0 && e.Delta != 1)
            {
                // Reset stack
                redo.Clear();
               
                // Disable
                redoToolStripMenuItem.Enabled = false;
            }


            // Update
            update();
        }


        /// <summary>
        /// Disable MenuItem group
        /// </summary>
        private void disable()
        {
            // Disable undo
            undoToolStripMenuItem.Enabled = false;


            // Disable new
            newToolStripMenuItem.Enabled = false;


            // Disable save spins
            saveToolStripMenuItem.Enabled = false;
        }


        /// <summary>
        /// Enable MenuItem group
        /// </summary>
        private void enable()
        {
            // Enable undo
            undoToolStripMenuItem.Enabled = true;


            // Enable new
            newToolStripMenuItem.Enabled = true;


            // Enable save spins
            saveToolStripMenuItem.Enabled = true;
        }


        /// <summary>
        /// Update procedure
        /// </summary>
        private void update()
        {
            // Set dictionary of int, List<Split>
            Dictionary<int, List<Split>> SpD = new Dictionary<int, List<Split>>();


            // Reset every split counter
            foreach (Split sp in Splits)
            {
                // Zero it
                sp.count = 0;
            }


            // Set a count for iterations
            int iteration = 0;


            // Update X times
            foreach (int currentNumber in history)
            {
                // Rise iteration count
                ++iteration;


                // Update Splits list count
                foreach (Split sp in Splits)
                {
                    // If number in split matches input one
                    if (sp.n1 == currentNumber || sp.n2 == currentNumber)
                    {
                        // Rise one in .count
                        sp.count += 1;
                    }
                }


                // Check if must halt
                if (iteration == nudX.Value)
                {
                    // Time to break
                    break;
                }
            }


            // Set dictionary values
            foreach (Split sp in Splits)
            {
                // Account (or not) for unhit splits
                if (sp.count == 0 && !showUnhitSplitsToolStripMenuItem.Checked)
                {
                    // Unchecked, skip iteration
                    continue;
                }


                // Create dictionary entry if not present
                if (!SpD.ContainsKey(sp.count))
                {
                    // Add new list
                    SpD.Add(sp.count, new List<Split>() { sp });
                }
                else
                {
                    // Add split to index
                    SpD[sp.count].Add(sp);
                }
            }


            // Clear counter
            Counter.Clear();


            // Declare new int list
            List<int> intList = new List<int>();


            // Populate with dictionary keys
            foreach (KeyValuePair<int, List<Split>> kvp in SpD)
            {
                // Add key to list
                intList.Add(kvp.Key);
            }


            // Sort list
            intList.Sort();


            // Sync counter with dictionary using list
            for (int i = 0; i < intList.Count; ++i)
            {
                // Add to Counter
                Counter.Add(new SplitCount(intList[i], SpD[intList[i]]));
            }


            // Update status strip count
            tsslHistory.Text = history.Count.ToString();
        }


        /// <summary>
        /// Launch website in default browser
        /// </summary>
        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Open web
            LaunchSite();
        }


        /// <summary>
        /// Open website in default browser
        /// </summary>
        private void LaunchSite()
        {
            // Launch BetSelection.cc
            System.Diagnostics.Process.Start("http://betselection.cc");
        }


        /// <summary>
        /// Show about box
        /// </summary>
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Message
            MessageBox.Show("Sponsored by WannaWin for the BetSelection.cc community." + Environment.NewLine + Environment.NewLine + "Coded by: Victor/VLS" + Environment.NewLine + Environment.NewLine + "Point your browser to [url=http://www.BetSelection.cc]www.BetSelection.cc[/url] for more releases!" + Environment.NewLine + Environment.NewLine + "(Dec. 2012)", "About Last X Splits", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
        }


        /// <summary>
        /// Account for unhit splits
        /// </summary>
        private void showUnhitSplitsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked status
            showUnhitSplitsToolStripMenuItem.Checked = !showUnhitSplitsToolStripMenuItem.Checked;


            // Perform an update
            update();
        }


        /// <summary>
        /// Act upon change of X
        /// </summary>
        private void nudX_ValueChanged(object sender, EventArgs e)
        {
            // Trigger update
            update();
        }


        /// <summary>
        /// Launch website when form is closed
        /// </summary>
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            // Open web
            LaunchSite();
        }


        /// <summary>
        /// Save XMl file right before closing
        /// </summary>
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Check for confirmation
            if (confirmOnExitToolStripMenuItem.Checked)
            {
                // Prompt user
                if (MessageBox.Show("Exit the program now?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    // Cancel form close
                    e.Cancel = true;


                    // Exit procedure
                    return;
                }
            }


            // Instantiate XmlTextWriter
            XmlTextWriter writer = new XmlTextWriter(xmlFile, null);


            // Set formatting
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 4;


            // Document start
            writer.WriteStartDocument();


            // Root start
            writer.WriteStartElement("LastXSplits");


            // Options start
            writer.WriteStartElement("Options");


            // Write options
            foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
            {
                // Save checked status
                writer.WriteElementString(tsmi.Name.Replace("ToolStripMenuItem", ""), tsmi.CheckState.ToString());
            }


            // Options end
            writer.WriteEndElement();


            // Coordinates start
            writer.WriteStartElement("Coordinates");


            // Iterate through forms
            foreach (Form frm in Application.OpenForms)
            {
                // Current form start
                writer.WriteStartElement(frm.Name);


                // Save coordinates
                writer.WriteElementString("x", frm.Left.ToString());
                writer.WriteElementString("y", frm.Top.ToString());


                // Current form end
                writer.WriteEndElement();
            }


            // Coordinates end
            writer.WriteEndElement();


            // LastX start
            writer.WriteStartElement("LastX");


            // X value
            writer.WriteElementString("X", nudX.Value.ToString());


            // LastX end
            writer.WriteEndElement();


            // Root start
            writer.WriteEndElement();


            // Document end
            writer.WriteEndDocument();


            // Close writer
            writer.Close();
        }


        /// <summary>
        /// TopMost for all forms
        /// </summary>
        private void topmostToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked
            topmostToolStripMenuItem.Checked = !topmostToolStripMenuItem.Checked;


            // Set TopMost in forms
            this.TopMost = topmostToolStripMenuItem.Checked;
            fCount.TopMost = topmostToolStripMenuItem.Checked;
            fHistory.TopMost = topmostToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Exit program by file menu
        /// </summary>
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Close main form
            this.Close();
        }


        /// <summary>
        /// Toggles flag for saving coordinates
        /// </summary>
        private void saveCoordinatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveCoordinatesToolStripMenuItem.Checked = !saveCoordinatesToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Toggles flag for saving X
        /// </summary>
        private void saveXToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveXToolStripMenuItem.Checked = !saveXToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Undo by menu
        /// </summary>
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Add to undo stack
            redo.Push(history.Peek());


            // Trigger MouseClick
            PictureBox_MouseClick(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Right, 1, 0, 0, 0));


            // Check redo menu state
            if (redoToolStripMenuItem.Enabled == false)
            {
                // Activate
                redoToolStripMenuItem.Enabled = true;
            }
        }


        /// <summary>
        /// Exit confirmation flag
        /// </summary>
        private void confirmOnExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            confirmOnExitToolStripMenuItem.Checked = !confirmOnExitToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Start new session by menu
        /// </summary>
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reset history
            history.Clear();


            // Reset history listbox
            lbHistory.Items.Clear();


            // Perform an update
            update();


            // Disable menu items
            disable();
        }


        /// <summary>
        /// Save history sipns
        /// </summary>
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Check there's something to save
            if (history.Count > 0)
            {
                // Instantiate SaveFileDialog
                SaveFileDialog sfd = new SaveFileDialog();


                // Set properties
                sfd.Filter = "Text Files|*.txt|All Files|*.*";
                sfd.Title = "Save an Image File";
               
                // Display dialog
                sfd.ShowDialog();


                // If there's a file
                if (sfd.FileName != "")
                {
                    // Stack enumerator
                    IEnumerator en = history.GetEnumerator();


                    // StringBuilder
                    StringBuilder sb = new StringBuilder();


                    // Transverse stack
                    while(en.MoveNext())
                    {
                        // Insert current with NewLine (for speed)
                        sb.Insert(0, en.Current.ToString() + Environment.NewLine);
                    }


                    // Remove last NewLine
                    sb.Remove(sb.ToString().LastIndexOf(Environment.NewLine), Environment.NewLine.Length);
                   
                    // Dump StringBuilder to file
                    File.WriteAllText(sfd.FileName, sb.ToString());
                }
            }
        }


        /// <summary>
        /// Redo menu
        /// </summary>
        private void redoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Perform click on last
            foreach (PictureBox pb in pbG)
            {
                // Check if names match
                if (redo.Peek() == Convert.ToInt32(pb.Name.Remove(0, 2)))
                {
                    // Match
                    PictureBox_MouseClick(pb, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 1, 0, 0, 1));


                    // Break for
                    break;
                }
            }


            // Pop last item
            redo.Pop();
           
            // Check for items
            if (redo.Count == 0)
            {
                // Disable
                redoToolStripMenuItem.Enabled = false;
            }
        }
    }


    /// <summary>
    /// Split class
    /// </summary>
    public class Split
    {
        // Count, First and second splits
        public int count, n1, n2;


        // Overloaded constructor
        public Split(int first, int second)
        {
            // Set first number
            n1 = first;


            // Set second number
            n2 = second;
        }
    }


    /// <summary>
    /// SplitCount Class
    /// </summary>
    public class SplitCount
    {
        // Shows
        public int _shows;


        // Splits
        public List<Split> _splits;


        /// <summary>
        /// Overloaded constructor
        /// </summary>
        /// <param name="shows">int for shows</param>
        /// <param name="splits">List of Split</param>
        public SplitCount(int shows, List<Split> splits)
        {
            _shows = shows;
            _splits = splits;
        }


        /// <summary>
        /// Shows property
        /// </summary>
        public int Shows
        {
            get { return _shows; }
            set { _shows = value; }
        }


        /// <summary>
        /// Splits property
        /// </summary>
        public string Splits
        {
            get
            {
                // Splits string
                string splits = "";


                // Populate splits string
                foreach (Split sp in _splits)
                {
                    // First number + second number + comma and space (added after every split for speed)
                    splits += sp.n1 + "-" + sp.n2 + ", ";
                }


                // Strip last comma and space
                splits = splits.Substring(0, splits.Length - 2);


                // Return processed string
                return splits;
            }
        }
    }
}
#269
General Discussion / Chat room?
December 25, 2012, 03:54:08 PM
Hi Guys,


What are your views regarding a chat room for the forum?

Voice your opinion!
(Polling for most-wanted features to include as 2013 is almost here :) )
#270
General Discussion / Lottery and Slots
December 25, 2012, 03:52:08 PM

Do we have fellows who buy lottery tickets?


Hitting the slots?  :)
#271
General Discussion / Christmas Thanks to the Forum
December 25, 2012, 03:40:19 PM
...Even if the site itself doesn't have a year, I feel compelled to say thanks to all the members for your support this year 2102.

My family sends a heartfelt "Thank You".

It brings us much happiness since the good will of fellow members has reached us at a personal level. My boy's got some new toys and my wife's got new clothes thanks to your Christmas generosity.

All who supported have a special PM with an offer for a program of their choice.

May 2013 be a year of much progress to all of us around. This year sure has brought much Love and Joy.

Have a Merry Christmas and a happy new year 2013.

Victor & Family
#272
Archive / [DEV] LastXSplits Release Candidate preview
December 24, 2012, 06:47:29 AM
You have this Release Candidate preview:

Download => [attachmini=2]

[attachimg=1]

Everything but redo works.

I wanted to finish it, but it's too darn late! Past 2a,m I still need to get some sleep for Christmas eve.

Enjoy!
Vic




Code (csharp) Select

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Xml.XPath;

namespace LastXSplits_0_1
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public Form1()
        {
            // Initialization
            InitializeComponent();
        }

        // History implemented as stack (LIFO)
        Stack<int> history = new Stack<int>();

        // Redo implemented as stack too
        Stack<int> redo = new Stack<int>();

        // Splits as List of Split class
        List<Split> Splits = new List<Split>() { new Split(1, 0), new Split(2, 0), new Split(3, 0), new Split(1, 2), new Split(1, 4), new Split(2, 3), new Split(2, 5), new Split(3, 6), new Split(4, 5), new Split(4, 7), new Split(5, 6), new Split(5,, new Split(6, 9), new Split(7,, new Split(7, 10), new Split(8, 9), new Split(8, 11), new Split(9, 12), new Split(10, 11), new Split(10, 13), new Split(11, 12), new Split(11, 14), new Split(12, 15), new Split(13, 14), new Split(13, 16), new Split(14, 15), new Split(14, 17), new Split(15, 18), new Split(16, 17), new Split(16, 19), new Split(17, 18), new Split(17, 20), new Split(18, 21), new Split(19, 20), new Split(19, 22), new Split(20, 21), new Split(20, 23), new Split(21, 24), new Split(22, 23), new Split(22, 25), new Split(23, 24), new Split(23, 26), new Split(24, 27), new Split(25, 26), new Split(25, 28), new Split(26, 27), new Split(26, 29), new Split(27, 30), new Split(28, 29), new Split(28, 31), new Split(29, 30), new Split(29, 32), new Split(30, 33), new Split(31, 32), new Split(31, 34), new Split(32, 33), new Split(32, 35), new Split(33, 36), new Split(34, 35), new Split(35, 36) };

        // Counter as BindingList of SplitCount (bound to DataGridView in FormCount)
        BindingList<SplitCount> Counter = new BindingList<SplitCount>();

        // Instantiate history form
        Form fHistory = new FormHistory();

        // Instantiate counter form
        Form fCount = new FormCount();

        // Reference to DataGridView
        DataGridView dgvCount;

        // Reference to History ListBox
        ListBox lbHistory;

        // Global PictureBox Array
        PictureBox[] pbG;

        // XML settings Filename
        string xmlFile = Path.GetDirectoryName(Application.ExecutablePath) + "\\LastXSplits.xml";

        /// <summary>
        /// Program's entrypoint
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            // Declare control array
            PictureBox[] pbCtrl = { pb0, pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8, pb9, pb10, pb11, pb12, pb13, pb14, pb15, pb16, pb17, pb18, pb19, pb20, pb21, pb22, pb23, pb24, pb25, pb26, pb27, pb28, pb29, pb30, pb31, pb32, pb33, pb34, pb35, pb36 };

            // Assign references
            pbG = pbCtrl;

            // Attach events to each control
            foreach (PictureBox ctrl in pbCtrl)
            {
                // MouseLeave
                ctrl.MouseLeave += new EventHandler(PictureBox_MouseLeave);

                // MouseEnter
                ctrl.MouseEnter += new EventHandler(PictureBox_MouseEnter);

                // MouseDown
                ctrl.MouseDown += new MouseEventHandler(PictureBox_MouseDown);

                // MouseUp
                ctrl.MouseUp += new MouseEventHandler(PictureBox_MouseUp);

                // MouseClick
                ctrl.MouseClick += new MouseEventHandler(PictureBox_MouseClick);
            }

            // Set dgvCount
            dgvCount = (DataGridView)fCount.Controls["dgvCount"];

            // Prevent automatic generation of columns
            dgvCount.AutoGenerateColumns = false;

            // Add shows column
            DataGridViewTextBoxColumn showsColumn = new DataGridViewTextBoxColumn();
            showsColumn.DataPropertyName = "Shows";
            showsColumn.HeaderText = "Shows";
            showsColumn.Width = 50;
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            showsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            dgvCount.Columns.Add(showsColumn);

            // Add splits column
            DataGridViewTextBoxColumn splitsColumn = new DataGridViewTextBoxColumn();
            splitsColumn.DataPropertyName = "Splits";
            splitsColumn.HeaderText = "Splits";
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            splitsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            splitsColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgvCount.Columns.Add(splitsColumn);

            // Set dgvCount DataSource
            dgvCount.DataSource = Counter;

            // Set lbHistory
            lbHistory = (ListBox)fHistory.Controls["lbHistory"];

            // Show history form
            fHistory.Show();

            // Show counters form
            fCount.Show();

            // Check for XML file
            if (File.Exists(xmlFile))
            {
                // Set XPath Document               
                XPathDocument document = new XPathDocument(xmlFile);

                // Create XPath Navigator
                XPathNavigator navigator = document.CreateNavigator();

                // Process Options
                foreach (XPathNavigator section in navigator.Select("/LastXSplits/Options"))
                {
                    foreach (XPathNavigator node in section.SelectChildren(XPathNodeType.All))
                    {
                        // Toggle options
                        foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
                        {
                            // Set CheckState
                            if (tsmi.Name == node.Name + "ToolStripMenuItem")
                            {
                                // Load from file
                                tsmi.CheckState = (node.InnerXml == "Checked" ? CheckState.Checked : CheckState.Unchecked);
                            }
                        }
                    }
                }

                // Coordinates
                if (saveCoordinatesToolStripMenuItem.Checked)
                {
                    // Process
                    foreach (XPathNavigator section in navigator.Select("/LastXSplits/Coordinates"))
                    {
                        foreach (XPathNavigator subsection in section.SelectChildren(XPathNodeType.All))
                        {
                            // Process forms
                            foreach (Form frm in Application.OpenForms)
                            {
                                // Match
                                if (frm.Name == subsection.Name)
                                {
                                    // Set X,Y
                                    foreach (XPathNavigator node in subsection.SelectChildren(XPathNodeType.All))
                                    {
                                        // X
                                        if (node.Name == "x")
                                        {
                                            frm.Left = Convert.ToInt32(node.InnerXml);
                                        }

                                        // Y
                                        if (node.Name == "y")
                                        {
                                            frm.Top = Convert.ToInt32(node.InnerXml);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                // Last X value
                if (saveXToolStripMenuItem.Checked)
                {
                    // Set X
                    nudX.Value = Convert.ToInt32(navigator.SelectSingleNode("/LastXSplits/LastX/X").InnerXml);
                }
            }
            else
            {
                // Default options check state
                topmostToolStripMenuItem.Checked = true;
                saveCoordinatesToolStripMenuItem.Checked = true;
                saveXToolStripMenuItem.Checked = true;

                // Default "X"
                nudX.Value = 18;
            }
        }

        /// <summary>
        /// MouseEnter handler
        /// </summary>
        private void PictureBox_MouseEnter(object sender, System.EventArgs e)
        {
            // Show alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;
        }

        /// <summary>
        /// MouseLeave handler
        /// </summary>
        private void PictureBox_MouseLeave(object sender, System.EventArgs e)
        {
            // Remove image
            ((PictureBox)sender).BackgroundImage = null;
        }

        /// <summary>
        /// MouseDown Handler
        /// </summary>
        private void PictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            // Check for left button
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Change cursor to hand
                ((PictureBox)sender).Cursor = Cursors.Hand;

                // Show blue alpha-blended image
                ((PictureBox)sender).BackgroundImage = Properties.Resources.blue_highlight_alpha_38x47;
            }
        }

        /// <summary>
        /// MouseUp Handler
        /// </summary>
        private void PictureBox_MouseUp(object sender, MouseEventArgs e)
        {
            // Show yellow alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;

            // Change cursor back
            ((PictureBox)sender).Cursor = Cursors.Default;
        }

        /// <summary>
        /// MouseClick handler
        /// </summary>
        private void PictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            /* Right click = UNDO */

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                // Check there's history
                if (history.Count > 0)
                {
                    // Pop last one
                    history.Pop();

                    // Remove from history ListBox
                    lbHistory.Items.RemoveAt(0);
                }

                // Disable if no history
                if (history.Count == 0)
                {
                    // Disable
                    disable();
                }

                // Update
                update();

                // Halt flow
                return;
            }

            // Check sender
            if (!(sender is PictureBox))
            {
                // Halt flow too
                return;
            }

            /* Left click = add to history */

            // Snip number
            int number = Convert.ToInt32(((PictureBox)sender).Name.ToString().Substring(2));

            // Push onto history stack
            history.Push(number);

            // Add to history ListBox
            lbHistory.Items.Insert(0, number);

            // Enable on first item
            if (history.Count == 1)
            {
                enable();
            }

            // Disable redo
            if (redo.Count > 0)
            {
                MessageBox.Show(redo.Peek().ToString());

                // Reset stack
                redo.Clear();
               
                // Disable
                redoToolStripMenuItem.Enabled = false;
            }

            // Update
            update();
        }

        /// <summary>
        /// Disable MenuItem group
        /// </summary>
        private void disable()
        {
            // Disable undo
            undoToolStripMenuItem.Enabled = false;

            // Disable new
            newToolStripMenuItem.Enabled = false;

            // Disable save spins
            saveToolStripMenuItem.Enabled = false;
        }

        /// <summary>
        /// Enable MenuItem group
        /// </summary>
        private void enable()
        {
            // Enable undo
            undoToolStripMenuItem.Enabled = true;

            // Enable new
            newToolStripMenuItem.Enabled = true;

            // Enable save spins
            saveToolStripMenuItem.Enabled = true;
        }

        /// <summary>
        /// Update procedure
        /// </summary>
        private void update()
        {
            // Set dictionary of int, List<Split>
            Dictionary<int, List<Split>> SpD = new Dictionary<int, List<Split>>();

            // Reset every split counter
            foreach (Split sp in Splits)
            {
                // Zero it
                sp.count = 0;
            }

            // Set a count for iterations
            int iteration = 0;

            // Update X times
            foreach (int currentNumber in history)
            {
                // Rise iteration count
                ++iteration;

                // Update Splits list count
                foreach (Split sp in Splits)
                {
                    // If number in split matches input one
                    if (sp.n1 == currentNumber || sp.n2 == currentNumber)
                    {
                        // Rise one in .count
                        sp.count += 1;
                    }
                }

                // Check if must halt
                if (iteration == nudX.Value)
                {
                    // Time to break
                    break;
                }
            }

            // Set dictionary values
            foreach (Split sp in Splits)
            {
                // Account (or not) for unhit splits
                if (sp.count == 0 && !showUnhitSplitsToolStripMenuItem.Checked)
                {
                    // Unchecked, skip iteration
                    continue;
                }

                // Create dictionary entry if not present
                if (!SpD.ContainsKey(sp.count))
                {
                    // Add new list
                    SpD.Add(sp.count, new List<Split>() { sp });
                }
                else
                {
                    // Add split to index
                    SpD[sp.count].Add(sp);
                }
            }

            // Clear counter
            Counter.Clear();

            // Declare new int list
            List<int> intList = new List<int>();

            // Populate with dictionary keys
            foreach (KeyValuePair<int, List<Split>> kvp in SpD)
            {
                // Add key to list
                intList.Add(kvp.Key);
            }

            // Sort list
            intList.Sort();

            // Sync counter with dictionary using list
            for (int i = 0; i < intList.Count; ++i)
            {
                // Add to Counter
                Counter.Add(new SplitCount(intList[i], SpD[intList[i]]));
            }

            // Update status strip count
            tsslHistory.Text = history.Count.ToString();
        }

        /// <summary>
        /// Launch website in default browser
        /// </summary>
        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Open web
            LaunchSite();
        }

        /// <summary>
        /// Open website in default browser
        /// </summary>
        private void LaunchSite()
        {
            // Launch BetSelection.cc
            System.Diagnostics.Process.Start("http://betselection.cc");
        }

        /// <summary>
        /// Show about box
        /// </summary>
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Message
            MessageBox.Show("Sponsored by WannaWin for the BetSelection.cc community." + Environment.NewLine + Environment.NewLine + "Coded by: Victor/VLS" + Environment.NewLine + Environment.NewLine + "Point your browser to [url=http://www.BetSelection.cc]www.BetSelection.cc[/url] for more releases!" + Environment.NewLine + Environment.NewLine + "(Dec. 2012)", "About Last X Splits", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
        }

        /// <summary>
        /// Account for unhit splits
        /// </summary>
        private void showUnhitSplitsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked status
            showUnhitSplitsToolStripMenuItem.Checked = !showUnhitSplitsToolStripMenuItem.Checked;

            // Perform an update
            update();
        }

        /// <summary>
        /// Act upon change of X
        /// </summary>
        private void nudX_ValueChanged(object sender, EventArgs e)
        {
            // Trigger update
            update();
        }

        /// <summary>
        /// Launch website when form is closed
        /// </summary>
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            // Open web
            LaunchSite();
        }

        /// <summary>
        /// Save XMl file right before closing
        /// </summary>
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Check for confirmation
            if (confirmOnExitToolStripMenuItem.Checked)
            {
                // Prompt user
                if (MessageBox.Show("Exit the program now?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    // Cancel form close
                    e.Cancel = true;

                    // Exit procedure
                    return;
                }
            }

            // Instantiate XmlTextWriter
            XmlTextWriter writer = new XmlTextWriter(xmlFile, null);

            // Set formatting
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 4;

            // Document start
            writer.WriteStartDocument();

            // Root start
            writer.WriteStartElement("LastXSplits");

            // Options start
            writer.WriteStartElement("Options");

            // Write options
            foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
            {
                // Save checked status
                writer.WriteElementString(tsmi.Name.Replace("ToolStripMenuItem", ""), tsmi.CheckState.ToString());
            }

            // Options end
            writer.WriteEndElement();

            // Coordinates start
            writer.WriteStartElement("Coordinates");

            // Iterate through forms
            foreach (Form frm in Application.OpenForms)
            {
                // Current form start
                writer.WriteStartElement(frm.Name);

                // Save coordinates
                writer.WriteElementString("x", frm.Left.ToString());
                writer.WriteElementString("y", frm.Top.ToString());

                // Current form end
                writer.WriteEndElement();
            }

            // Coordinates end
            writer.WriteEndElement();

            // LastX start
            writer.WriteStartElement("LastX");

            // X value
            writer.WriteElementString("X", nudX.Value.ToString());

            // LastX end
            writer.WriteEndElement();

            // Root start
            writer.WriteEndElement();

            // Document end
            writer.WriteEndDocument();

            // Close writer
            writer.Close();
        }

        /// <summary>
        /// TopMost for all forms
        /// </summary>
        private void topmostToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked
            topmostToolStripMenuItem.Checked = !topmostToolStripMenuItem.Checked;

            // Set TopMost in forms
            this.TopMost = topmostToolStripMenuItem.Checked;
            fCount.TopMost = topmostToolStripMenuItem.Checked;
            fHistory.TopMost = topmostToolStripMenuItem.Checked;
        }

        /// <summary>
        /// Exit program by file menu
        /// </summary>
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Close main form
            this.Close();
        }

        /// <summary>
        /// Toggles flag for saving coordinates
        /// </summary>
        private void saveCoordinatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveCoordinatesToolStripMenuItem.Checked = !saveCoordinatesToolStripMenuItem.Checked;
        }

        /// <summary>
        /// Toggles flag for saving X
        /// </summary>
        private void saveXToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveXToolStripMenuItem.Checked = !saveXToolStripMenuItem.Checked;
        }

        /// <summary>
        /// Undo by menu
        /// </summary>
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Add to undo stack
            redo.Push(history.Peek());

            // Trigger MouseClick
            PictureBox_MouseClick(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Right, 1, 0, 0, 0));

            // Check redo menu state
            if (redoToolStripMenuItem.Enabled == false)
            {
                // Activate
                redoToolStripMenuItem.Enabled = true;
            }
        }

        /// <summary>
        /// Exit confirmation flag
        /// </summary>
        private void confirmOnExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            confirmOnExitToolStripMenuItem.Checked = !confirmOnExitToolStripMenuItem.Checked;
        }

        /// <summary>
        /// Start new session by menu
        /// </summary>
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reset history
            history.Clear();

            // Reset history listbox
            lbHistory.Items.Clear();

            // Perform an update
            update();

            // Disable menu items
            disable();
        }

        /// <summary>
        /// Save history sipns
        /// </summary>
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Check there's something to save
            if (history.Count > 0)
            {
                // Instantiate SaveFileDialog
                SaveFileDialog sfd = new SaveFileDialog();

                // Set properties
                sfd.Filter = "Text Files|*.txt|All Files|*.*";
                sfd.Title = "Save an Image File";
               
                // Display dialog
                sfd.ShowDialog();

                // If there's a file
                if (sfd.FileName != "")
                {
                    // Stack enumerator
                    IEnumerator en = history.GetEnumerator();

                    // StringBuilder
                    StringBuilder sb = new StringBuilder();

                    // Transverse stack
                    while(en.MoveNext())
                    {
                        // Insert current with NewLine (for speed)
                        sb.Insert(0, en.Current.ToString() + Environment.NewLine);
                    }

                    // Remove last NewLine
                    sb.Remove(sb.ToString().LastIndexOf(Environment.NewLine), Environment.NewLine.Length);
                   
                    // Dump StringBuilder to file
                    File.WriteAllText(sfd.FileName, sb.ToString());
                }
            }
        }

        /// <summary>
        /// Redo menu
        /// </summary>
        private void redoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Perform click on last
            foreach (PictureBox pb in pbG)
            {
                // Check if names match
                if (redo.Peek() == Convert.ToInt32(pb.Name.Remove(0, 2)))
                {
                    // Match
                    PictureBox_MouseClick(pb, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 1, 0, 0, 0));
                }
            }

            // Pop last item
            redo.Pop();
           
            // Check for items
            if (redo.Count == 0)
            {
                // Disable
                redoToolStripMenuItem.Enabled = false;
            }
        }
    }

    /// <summary>
    /// Split class
    /// </summary>
    public class Split
    {
        // Count, First and second splits
        public int count, n1, n2;

        // Overloaded constructor
        public Split(int first, int second)
        {
            // Set first number
            n1 = first;

            // Set second number
            n2 = second;
        }
    }

    /// <summary>
    /// SplitCount Class
    /// </summary>
    public class SplitCount
    {
        // Shows
        public int _shows;

        // Splits
        public List<Split> _splits;

        /// <summary>
        /// Overloaded constructor
        /// </summary>
        /// <param name="shows">int for shows</param>
        /// <param name="splits">List of Split</param>
        public SplitCount(int shows, List<Split> splits)
        {
            _shows = shows;
            _splits = splits;
        }

        /// <summary>
        /// Shows property
        /// </summary>
        public int Shows
        {
            get { return _shows; }
            set { _shows = value; }
        }

        /// <summary>
        /// Splits property
        /// </summary>
        public string Splits
        {
            get
            {
                // Splits string
                string splits = "";

                // Populate splits string
                foreach (Split sp in _splits)
                {
                    // First number + second number + comma and space (added after every split for speed)
                    splits += sp.n1 + "-" + sp.n2 + ", ";
                }

                // Strip last comma and space
                splits = splits.Substring(0, splits.Length - 2);

                // Return processed string
                return splits;
            }
        }
    }
}
#273
Archive / [DEV] LastXSplits 2012-12-23
December 22, 2012, 06:45:02 AM
New version of LastXSplits.

Download:=> [attachmini=1]




Everything but Redo, New, Save is working.

Please test and confirm. Thank you.





Source code:

Code (csharp) Select
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Xml.XPath;


namespace LastXSplits_0_1
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public Form1()
        {
            // Initialization
            InitializeComponent();
        }


        // History implemented as stack (LIFO)
        Stack<int> history = new Stack<int>();


        // Splits as List of Split class
        List<Split> Splits = new List<Split>() { new Split(1, 0), new Split(2, 0), new Split(3, 0), new Split(1, 2), new Split(1, 4), new Split(2, 3), new Split(2, 5), new Split(3, 6), new Split(4, 5), new Split(4, 7), new Split(5, 6), new Split(5,, new Split(6, 9), new Split(7,, new Split(7, 10), new Split(8, 9), new Split(8, 11), new Split(9, 12), new Split(10, 11), new Split(10, 13), new Split(11, 12), new Split(11, 14), new Split(12, 15), new Split(13, 14), new Split(13, 16), new Split(14, 15), new Split(14, 17), new Split(15, 18), new Split(16, 17), new Split(16, 19), new Split(17, 18), new Split(17, 20), new Split(18, 21), new Split(19, 20), new Split(19, 22), new Split(20, 21), new Split(20, 23), new Split(21, 24), new Split(22, 23), new Split(22, 25), new Split(23, 24), new Split(23, 26), new Split(24, 27), new Split(25, 26), new Split(25, 28), new Split(26, 27), new Split(26, 29), new Split(27, 30), new Split(28, 29), new Split(28, 31), new Split(29, 30), new Split(29, 32), new Split(30, 33), new Split(31, 32), new Split(31, 34), new Split(32, 33), new Split(32, 35), new Split(33, 36), new Split(34, 35), new Split(35, 36) };


        // Counter as BindingList of SplitCount (bound to DataGridView in FormCount)
        BindingList<SplitCount> Counter = new BindingList<SplitCount>();


        // Instantiate history form
        Form fHistory = new FormHistory();


        // Instantiate counter form
        Form fCount = new FormCount();


        // Reference to DataGridView
        DataGridView dgvCount;


        // Reference to History ListBox
        ListBox lbHistory;


        // XML settings Filename
        string xmlFile = Path.GetDirectoryName(Application.ExecutablePath) + "\\LastXSplits.xml";


        /// <summary>
        /// Program's entrypoint
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            // Declare control array
            PictureBox[] pbCtrl = { pb0, pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8, pb9, pb10, pb11, pb12, pb13, pb14, pb15, pb16, pb17, pb18, pb19, pb20, pb21, pb22, pb23, pb24, pb25, pb26, pb27, pb28, pb29, pb30, pb31, pb32, pb33, pb34, pb35, pb36 };


            // Attach events to each control
            foreach (PictureBox ctrl in pbCtrl)
            {
                // MouseLeave
                ctrl.MouseLeave += new EventHandler(PictureBox_MouseLeave);


                // MouseEnter
                ctrl.MouseEnter += new EventHandler(PictureBox_MouseEnter);


                // MouseDown
                ctrl.MouseDown += new MouseEventHandler(PictureBox_MouseDown);


                // MouseUp
                ctrl.MouseUp += new MouseEventHandler(PictureBox_MouseUp);


                // MouseClick
                ctrl.MouseClick += new MouseEventHandler(PictureBox_MouseClick);
            }


            // Set dgvCount
            dgvCount = (DataGridView)fCount.Controls["dgvCount"];


            // Prevent automatic generation of columns
            dgvCount.AutoGenerateColumns = false;


            // Add shows column
            DataGridViewTextBoxColumn showsColumn = new DataGridViewTextBoxColumn();
            showsColumn.DataPropertyName = "Shows";
            showsColumn.HeaderText = "Shows";
            showsColumn.Width = 50;
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            showsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            dgvCount.Columns.Add(showsColumn);


            // Add splits column
            DataGridViewTextBoxColumn splitsColumn = new DataGridViewTextBoxColumn();
            splitsColumn.DataPropertyName = "Splits";
            splitsColumn.HeaderText = "Splits";
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            splitsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            splitsColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgvCount.Columns.Add(splitsColumn);


            // Set dgvCount DataSource
            dgvCount.DataSource = Counter;


            // Set lbHistory
            lbHistory = (ListBox)fHistory.Controls["lbHistory"];


            // Show history form
            fHistory.Show();


            // Show counters form
            fCount.Show();


            // Check for XML file
            if (File.Exists(xmlFile))
            {
                // Set XPath Document               
                XPathDocument document = new XPathDocument(xmlFile);


                // Create XPath Navigator
                XPathNavigator navigator = document.CreateNavigator();


                // Process Options
                foreach (XPathNavigator section in navigator.Select("/LastXSplits/Options"))
                {
                    foreach (XPathNavigator node in section.SelectChildren(XPathNodeType.All))
                    {
                        // Toggle options
                        foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
                        {
                            // Set CheckState
                            if (tsmi.Name == node.Name + "ToolStripMenuItem")
                            {
                                // Load from file
                                tsmi.CheckState = (node.InnerXml == "Checked" ? CheckState.Checked : CheckState.Unchecked);
                            }
                        }
                    }
                }


                // Coordinates
                if (saveCoordinatesToolStripMenuItem.Checked)
                {
                    // Process
                    foreach (XPathNavigator section in navigator.Select("/LastXSplits/Coordinates"))
                    {
                        foreach (XPathNavigator subsection in section.SelectChildren(XPathNodeType.All))
                        {
                            // Process forms
                            foreach (Form frm in Application.OpenForms)
                            {
                                // Match
                                if (frm.Name == subsection.Name)
                                {
                                    // Set X,Y
                                    foreach (XPathNavigator node in subsection.SelectChildren(XPathNodeType.All))
                                    {
                                        // X
                                        if (node.Name == "x")
                                        {
                                            frm.Left = Convert.ToInt32(node.InnerXml);
                                        }


                                        // Y
                                        if (node.Name == "y")
                                        {
                                            frm.Top = Convert.ToInt32(node.InnerXml);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }


                // Last X value
                if(saveXToolStripMenuItem.Checked)
                {
                    // Set X
                    nudX.Value = Convert.ToInt32(navigator.SelectSingleNode("/LastXSplits/LastX/X").InnerXml);
                }
            }
            else
            {
                // Default options check state
                topmostToolStripMenuItem.Checked = true;
                saveCoordinatesToolStripMenuItem.Checked = true;
                saveXToolStripMenuItem.Checked = true;


                // Default "X"
                nudX.Value = 18;
            }
        }


        /// <summary>
        /// MouseEnter handler
        /// </summary>
        private void PictureBox_MouseEnter(object sender, System.EventArgs e)
        {
            // Show alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;
        }


        /// <summary>
        /// MouseLeave handler
        /// </summary>
        private void PictureBox_MouseLeave(object sender, System.EventArgs e)
        {
            // Remove image
            ((PictureBox)sender).BackgroundImage = null;
        }


        /// <summary>
        /// MouseDown Handler
        /// </summary>
        private void PictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            // Check for left button
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Change cursor to hand
                ((PictureBox)sender).Cursor = Cursors.Hand;


                // Show blue alpha-blended image
                ((PictureBox)sender).BackgroundImage = Properties.Resources.blue_highlight_alpha_38x47;
            }
        }


        /// <summary>
        /// MouseUp Handler
        /// </summary>
        private void PictureBox_MouseUp(object sender, MouseEventArgs e)
        {
            // Show yellow alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;


            // Change cursor back
            ((PictureBox)sender).Cursor = Cursors.Default;
        }


        /// <summary>
        /// MouseClick handler
        /// </summary>
        private void PictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            /* Right click = UNDO */


            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                // Check there's something
                if (history.Count > 0)
                {
                    // Pop last one
                    history.Pop();


                    // Remove from history ListBox
                    lbHistory.Items.RemoveAt(0);
                }


                // Update
                update();


                // Halt flow
                return;
            }


            // Check sender
            if (!(sender is PictureBox))
            {
                // Halt flow too
                return;
            }


            /* Left click = add to history */


            // Snip number
            int number = Convert.ToInt32(((PictureBox)sender).Name.ToString().Substring(2));


            // Push onto history stack
            history.Push(number);


            // Add to history ListBox
            lbHistory.Items.Insert(0, number);


            // Update
            update();
        }


        /// <summary>
        /// Update procedure
        /// </summary>
        private void update()
        {
            // Set dictionary of int, List<Split>
            Dictionary<int, List<Split>> SpD = new Dictionary<int, List<Split>>();


            // Reset every split counter
            foreach (Split sp in Splits)
            {
                // Zero it
                sp.count = 0;
            }


            // Set a count for iterations
            int iteration = 0;


            // Update X times
            foreach (int currentNumber in history)
            {
                // Rise iteration count
                ++iteration;


                // Update Splits list count
                foreach (Split sp in Splits)
                {
                    // If number in split matches input one
                    if (sp.n1 == currentNumber || sp.n2 == currentNumber)
                    {
                        // Rise one in .count
                        sp.count += 1;
                    }
                }


                // Check if must halt
                if (iteration == nudX.Value)
                {
                    // Time to break
                    break;
                }
            }


            // Set dictionary values
            foreach (Split sp in Splits)
            {
                // Account (or not) for unhit splits
                if (sp.count == 0 && !showUnhitSplitsToolStripMenuItem.Checked)
                {
                    // Unchecked, skip iteration
                    continue;
                }


                // Create dictionary entry if not present
                if (!SpD.ContainsKey(sp.count))
                {
                    // Add new list
                    SpD.Add(sp.count, new List<Split>() { sp });
                }
                else
                {
                    // Add split to index
                    SpD[sp.count].Add(sp);
                }
            }


            // Clear counter
            Counter.Clear();


            // Declare new int list
            List<int> intList = new List<int>();


            // Populate with dictionary keys
            foreach (KeyValuePair<int, List<Split>> kvp in SpD)
            {
                // Add key to list
                intList.Add(kvp.Key);
            }


            // Sort list
            intList.Sort();


            // Sync counter with dictionary using list
            for (int i = 0; i < intList.Count; ++i)
            {
                // Add to Counter
                Counter.Add(new SplitCount(intList[i], SpD[intList[i]]));
            }


            // Update status strip count
            tsslHistory.Text = history.Count.ToString();
        }


        /// <summary>
        /// Launch website in default browser
        /// </summary>
        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Open web
            LaunchSite();
        }


        /// <summary>
        /// Open website in default browser
        /// </summary>
        private void LaunchSite()
        {
            // Launch BetSelection.cc
            System.Diagnostics.Process.Start("http://betselection.cc");
        }


        /// <summary>
        /// Show about box
        /// </summary>
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Message
            MessageBox.Show("Sponsored by WannaWin for the BetSelection.cc community." + Environment.NewLine + Environment.NewLine + "Coded by: Victor/VLS" + Environment.NewLine + Environment.NewLine + "Point your browser to [url=http://www.BetSelection.cc]www.BetSelection.cc[/url] for more releases!" + Environment.NewLine + Environment.NewLine + "(Dec. 2012)", "About Last X Splits", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
        }


        /// <summary>
        /// Account for unhit splits
        /// </summary>
        private void showUnhitSplitsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked status
            showUnhitSplitsToolStripMenuItem.Checked = !showUnhitSplitsToolStripMenuItem.Checked;


            // Perform an update
            update();
        }


        /// <summary>
        /// Act upon change of X
        /// </summary>
        private void nudX_ValueChanged(object sender, EventArgs e)
        {
            // Trigger update
            update();
        }


        /// <summary>
        /// Launch website when form is closed
        /// </summary>
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            // Open web
            LaunchSite();
        }


        /// <summary>
        /// Save XMl file rigth before closing
        /// </summary>
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Instantiate XmlWriter
            XmlTextWriter writer = new XmlTextWriter(xmlFile, null);


            // Set formatting
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 4;


            // Document start
            writer.WriteStartDocument();


            // Root start
            writer.WriteStartElement("LastXSplits");
           
            // Options start
            writer.WriteStartElement("Options");


            // Write options
            foreach (ToolStripMenuItem tsmi in optionsToolStripMenuItem.DropDownItems)
            {
                // Save checked status
                writer.WriteElementString(tsmi.Name.Replace("ToolStripMenuItem", ""), tsmi.CheckState.ToString());
            }


            // Options end
            writer.WriteEndElement();


            // Coordinates start
            writer.WriteStartElement("Coordinates");


            // Iterate through forms
            foreach (Form frm in Application.OpenForms)
            {
                // Current form start
                writer.WriteStartElement(frm.Name);


                // Save coordinates
                writer.WriteElementString("x", frm.Left.ToString());
                writer.WriteElementString("y", frm.Top.ToString());


                // Current form end
                writer.WriteEndElement();
            }


            // Coordinates end
            writer.WriteEndElement();


            // LastX start
            writer.WriteStartElement("LastX");


            // X value
            writer.WriteElementString("X", nudX.Value.ToString());


            // LastX end
            writer.WriteEndElement();


            // Root start
            writer.WriteEndElement();


            // Document end
            writer.WriteEndDocument();


            // Close writer
            writer.Close();
        }


        /// <summary>
        /// TopMost for all forms
        /// </summary>
        private void topmostToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked
            topmostToolStripMenuItem.Checked = !topmostToolStripMenuItem.Checked;


            // Set TopMost in forms
            this.TopMost = topmostToolStripMenuItem.Checked;
            fCount.TopMost = topmostToolStripMenuItem.Checked;
            fHistory.TopMost = topmostToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Exit program by file menu
        /// </summary>
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Close main form
            this.Close();
        }


        /// <summary>
        /// Toggles flag for saving coordinates
        /// </summary>
        private void saveCoordinatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveCoordinatesToolStripMenuItem.Checked = !saveCoordinatesToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Toggles flag for saving X
        /// </summary>
        private void saveXToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse
            saveXToolStripMenuItem.Checked = !saveXToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Undo by menu
        /// </summary>
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Trigger MouseClick
            PictureBox_MouseClick(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Right,1,0,0,0));
        }
    }


    /// <summary>
    /// Split class
    /// </summary>
    public class Split
    {
        // Count, First and second splits
        public int count, n1, n2;


        // Overloaded constructor
        public Split(int first, int second)
        {
            // Set first number
            n1 = first;


            // Set second number
            n2 = second;
        }
    }


    /// <summary>
    /// SplitCount Class
    /// </summary>
    public class SplitCount
    {
        // Shows
        public int _shows;


        // Splits
        public List<Split> _splits;


        /// <summary>
        /// Overloaded constructor
        /// </summary>
        /// <param name="shows">int for shows</param>
        /// <param name="splits">List of Split</param>
        public SplitCount(int shows, List<Split> splits)
        {
            _shows = shows;
            _splits = splits;
        }


        /// <summary>
        /// Shows property
        /// </summary>
        public int Shows
        {
            get { return _shows; }
            set { _shows = value; }
        }


        /// <summary>
        /// Splits property
        /// </summary>
        public string Splits
        {
            get
            {
                // Splits string
                string splits = "";


                // Populate splits string
                foreach (Split sp in _splits)
                {
                    // First number + second number + comma and space (added after every split for speed)
                    splits += sp.n1 + "-" + sp.n2 + ", ";
                }


                // Strip last comma and space
                splits = splits.Substring(0, splits.Length - 2);


                // Return processed string
                return splits;
            }
        }
    }
}
#274
General Discussion / Prompt recovery to Proofreader's mom
December 21, 2012, 01:40:19 PM
Guys, Proof's mother is ill.

He wrote:

QuoteCan't give a lot of attention to the board atm (got a ill mother and doctors)
http://www.rouletteforum.cc/index.php?topic=11626

Our wishes and prayers go to his mom and her prompt recovery.
#275
Corner/Quad / HCQ bet (1 to 3 quads)
December 20, 2012, 12:12:39 PM
HCQ stands for Hot and Cold Quads.

You can track it with a regular felt.

The bets are from 1 to at most 3 quads at a time, maximum one quad per dozen.

The methodology is this:

- Monitor all quads from each dozen separately.

- When a single quad is missing in a dozen, you bet it.

- If all the quads on the dozen have a hit, you back the one with most hits.

- In case of a tie on hits on two or more quads, skip them until the tie resolves.




A new cycle is started after a hit.

You can re-use the numbers "going backwards" (from most recent to oldest) until there is a new eligible quad to bet. Then continue with new spins from there until hit or cycle end.




This is a sample graph:


[attachimg=1]




HCQ is the bet selection; feel free to "plug" your matching money management scheme.

I would suggest a slow progression, going up after a hit. Resetting on any plus or break even.



Don't get stubborn. Spin 18 is cycle end.

Vic