f$swag, some handy stuff + rounding bet ammounts correctly

Post your single itemized commented rules here.<br>
Please read the guidelines before posting.

f$swag, some handy stuff + rounding bet ammounts correctly

Postby newbee » 2009 Apr 13 Mon 3:32:44 am

Here some example f$swag formula's, very handy when you build a NL bot.

Code: Select all
// When hu, and our opponents stack is max. 150% of the ammount
//I want to bet then push allin preflop (only hu cause could go wrong
//when there are more players still to act.
br==1 && nplayersplaying==2 && f$srai>0 && f$stackopponent<f$srai*1.5 ? balance :

// Postflop, when we have a medium hand (midpair) or higher and
// the stack of our opponent is less then 25 bigblinds, or same as above
br>1 && f$stackopponent>0 && f$srai>0 && prwin>.7 && (f$stackopponent<f$srai*1.5||f$stackopponent<25*bblind) ? balance :

// When our balance is more then the ammount we want to bet
// but not much more, push allin to avoid raises from shorty's
f$srai>0 && balance>f$srai && balance<f$srai*1.5 ? balance :

// When the ammount we want to bet is higher then our stack.
// At Fulltilt it's no issue to bet more then stack, it auto-corrects it.
// but at Ultimate for intsance we get a popup message that we want to
// bet an invalid ammount (very annoying) so this rule takes care of that.
f$srai>balance && balance>0 ? balance :

// Last one I don't really get but has to do with the fact that you don't bet strange ammounts like 0.17 or something, not working optimal though.
f$srai>=f$sraimin ? ((((f$swag_adjust+f$srai)/sblind))^0)*sblind :

0
Last edited by newbee on 2009 Apr 14 Tue 2:40:10 am, edited 1 time in total.
newbee
Full House
 
Posts: 226
Joined: 2008 Jun 27 Fri 5:26:43 am
Location: The Netherlands

Re: f$swag, Some things you don't think off!

Postby TheHighFish » 2009 Apr 13 Mon 4:55:30 pm

newbee wrote:
Code: Select all
// Last one I don't really get but has to do with the fact that you don't bet strange ammounts like 0.17 or something, not working optimal though.
f$srai>=f$sraimin ? ((((f$swag_adjust+f$srai)/sblind))^0)*sblind :
0


The last one is a bit tricky.
^ is the XOR-operator. http://www.winholdem.net/help/help-c.html
(meaning: either a or b, but not both)
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
You see, XOR with 0 wont change anything,
but bitwise operations are executed on integers,
so your number will be implicitly truncated, that's where "rounding" occurs.
To every thing there is a season, and a time to every purpose under the heaven:

My WinHoldem time is over.
User avatar
TheHighFish
Full House
 
Posts: 290
Joined: 2007 Jul 10 Tue 11:12:41 am

Re: f$swag, Some things you don't think off!

Postby newbee » 2009 Apr 13 Mon 6:18:48 pm

I have some question and hope you can answer them in very plain simple sentences :)

1 What is a bitwise operation?
2 What is "integers"?
3 what is truncated?

Btw the rounding isn't working that perfect cause lots of times I see it bet strange ammounts like 18 cents or 1.32 etc.

Hope I understand it a little bit:

Do this ((((f$swag_adjust+f$srai)/sblind))

Or ^

Do nothing 0

Both true not possible, neither is not true possible.
newbee
Full House
 
Posts: 226
Joined: 2008 Jun 27 Fri 5:26:43 am
Location: The Netherlands

Postby TheHighFish » 2009 Apr 13 Mon 6:38:47 pm

http://en.wikipedia.org/wiki/Bit
http://en.wikipedia.org/wiki/Binary_numeral_system

Bitwise operation: A operation executed on every single digit of binary data.
E.g. Negation. NOT 01001011 = 10110100

http://en.wikipedia.org/wiki/Integer

truncate: See any dictionary.
:wink:



You have some number: 3.141592...
calculate 3.141592... ^ 0
this requires an implicit transformation to an integer,
so you get 3^0, your number got truncated
3 = 00000011, 0 = 00000000
now you calculate a bitwise XOR
according to the table above
(xor with 0 doesn't change anything)

0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0

Code: Select all
    00000011
XOR 00000000
=   00000011

and you get 3 as result.
To every thing there is a season, and a time to every purpose under the heaven:

My WinHoldem time is over.
User avatar
TheHighFish
Full House
 
Posts: 290
Joined: 2007 Jul 10 Tue 11:12:41 am

Postby newbee » 2009 Apr 14 Tue 2:16:51 am

Thanks for the explanation but I still don't get it.

Soo to get rounded numbers I just created some code myself, a bit primitive but it works:

Code: Select all
##f$swag##
f$srai>f$sraimin ? f$swag_rounding :

##f$swag_rounding##
f$srai>0 && f$srai<=0.07 ? 0.05 :
f$srai>0.07 && f$srai<=0.12 ? 0.10 :
f$srai>0.12 && f$srai<=0.17 ? 0.15 :
f$srai>0.17 && f$srai<=0.22 ? 0.20 :
f$srai>0.22 && f$srai<=0.27 ? 0.25 :
f$srai>0.27 && f$srai<=0.32 ? 0.30 :
f$srai>0.32 && f$srai<=0.37 ? 0.35 :
f$srai>0.37 && f$srai<=0.42 ? 0.40 :
f$srai>0.42 && f$srai<=0.47 ? 0.45 :
f$srai>0.47 && f$srai<=0.52 ? 0.50 :
f$srai>0.52 && f$srai<=0.57 ? 0.55 :
f$srai>0.57 && f$srai<=0.62 ? 0.60 :
f$srai>0.62 && f$srai<=0.67 ? 0.65 :
f$srai>0.67 && f$srai<=0.72 ? 0.70 :
f$srai>0.72 && f$srai<=0.77 ? 0.75 :
f$srai>0.77 && f$srai<=0.82 ? 0.80 :
f$srai>0.82 && f$srai<=0.87 ? 0.85 :
f$srai>0.87 && f$srai<=0.92 ? 0.90 :
f$srai>0.92 && f$srai<=0.95 ? 0.95 :
f$srai>0.95 && f$srai<=1.05 ? 1 :

f$srai>1.05 && f$srai<=1.15 ? 1.10 :
f$srai>1.15 && f$srai<=1.25 ? 1.20 :
f$srai>1.25 && f$srai<=1.35 ? 1.30 :
f$srai>1.35 && f$srai<=1.45 ? 1.40 :
f$srai>1.45 && f$srai<=1.55 ? 1.50 :
f$srai>1.55 && f$srai<=1.65 ? 1.60 :
f$srai>1.65 && f$srai<=1.75 ? 1.70 :
f$srai>1.75 && f$srai<=1.85 ? 1.80 :
f$srai>1.85 && f$srai<=1.95 ? 1.90 :
f$srai>1.95 && f$srai<=2.05 ? 2 :

f$srai>2.05 && f$srai<=2.15 ? 2.10 :
f$srai>2.15 && f$srai<=2.25 ? 2.20 :
f$srai>2.25 && f$srai<=2.35 ? 2.30 :
f$srai>2.35 && f$srai<=2.45 ? 2.40 :
f$srai>2.45 && f$srai<=2.55 ? 2.50 :
f$srai>2.55 && f$srai<=2.65 ? 2.60 :
f$srai>2.65 && f$srai<=2.75 ? 2.70 :
f$srai>2.75 && f$srai<=2.85 ? 2.80 :
f$srai>2.85 && f$srai<=2.95 ? 2.90 :
f$srai>2.95 && f$srai<=3.05 ? 3 :

f$srai>3.05 && f$srai<=3.15 ? 3.10 :
f$srai>3.15 && f$srai<=3.25 ? 3.20 :
f$srai>3.25 && f$srai<=3.35 ? 3.30 :
f$srai>3.35 && f$srai<=3.45 ? 3.40 :
f$srai>3.45 && f$srai<=3.55 ? 3.50 :
f$srai>3.55 && f$srai<=3.65 ? 3.60 :
f$srai>3.65 && f$srai<=3.75 ? 3.70 :
f$srai>3.75 && f$srai<=3.85 ? 3.80 :
f$srai>3.85 && f$srai<=3.95 ? 3.90 :
f$srai>3.95 && f$srai<=4.05 ? 4 :

f$srai>4.05 && f$srai<=4.15 ? 4.10 :
f$srai>4.15 && f$srai<=4.25 ? 4.20 :
f$srai>4.25 && f$srai<=4.35 ? 4.30 :
f$srai>4.35 && f$srai<=4.45 ? 4.40 :
f$srai>4.45 && f$srai<=4.55 ? 4.50 :
f$srai>4.55 && f$srai<=4.65 ? 4.60 :
f$srai>4.65 && f$srai<=4.75 ? 4.70 :
f$srai>4.75 && f$srai<=4.85 ? 4.80 :
f$srai>4.85 && f$srai<=4.95 ? 4.90 :
f$srai>4.95 && f$srai<=5.10 ? 5 :

f$srai>5.10 && f$srai<=5.30 ? 5.20 :
f$srai>5.30 && f$srai<=5.50 ? 5.40 :
f$srai>5.50 && f$srai<=5.70 ? 5.60 :
f$srai>5.70 && f$srai<=5.90 ? 5.80 :
f$srai>5.90 && f$srai<=6.10 ? 6.00 :

f$srai>6.10 && f$srai<=6.30 ? 6.20 :
f$srai>6.30 && f$srai<=6.50 ? 6.40 :
f$srai>6.50 && f$srai<=6.70 ? 6.60 :
f$srai>6.70 && f$srai<=6.90 ? 6.80 :
f$srai>6.90 && f$srai<=7.10 ? 7.00 :

f$srai>7.10 && f$srai<=7.30 ? 7.20 :
f$srai>7.30 && f$srai<=7.50 ? 7.40 :
f$srai>7.50 && f$srai<=7.70 ? 7.60 :
f$srai>7.70 && f$srai<=7.90 ? 7.80 :
f$srai>7.90 && f$srai<=8.10 ? 8.00 :

f$srai>8.10 && f$srai<=8.30 ? 8.20 :
f$srai>8.30 && f$srai<=8.50 ? 8.40 :
f$srai>8.50 && f$srai<=8.70 ? 8.60 :
f$srai>8.70 && f$srai<=8.90 ? 8.80 :
f$srai>8.90 && f$srai<=9.10 ? 9.00 :

f$srai>9.10 && f$srai<=9.30 ? 9.20 :
f$srai>9.30 && f$srai<=9.50 ? 9.40 :
f$srai>9.50 && f$srai<=9.70 ? 9.60 :
f$srai>9.70 && f$srai<=9.90 ? 9.80 :
f$srai>9.90 && f$srai<=10.25 ? 10 :

f$srai>10.25 && f$srai<=10.75 ? 10.50 :
f$srai>10.75 && f$srai<=11.25 ? 11.00 :
f$srai>11.25 && f$srai<=11.75 ? 11.50 :
f$srai>11.75 && f$srai<=12.25 ? 12.00 :
f$srai>12.25 && f$srai<=12.75 ? 12.50 :
f$srai>12.75 && f$srai<=13.25 ? 13.00 :
f$srai>13.25 && f$srai<=13.75 ? 13.50 :
f$srai>13.75 && f$srai<=14.25 ? 14.00 :
f$srai>14.25 && f$srai<=14.75 ? 14.50 :
f$srai>14.75 && f$srai<=15.25 ? 15.00 :
f$srai>15.25 && f$srai<=15.75 ? 15.50 :
f$srai>15.75 && f$srai<=16.25 ? 16.00 :
f$srai>16.25 && f$srai<=16.75 ? 16.50 :
f$srai>16.75 && f$srai<=17.25 ? 17.00 :
f$srai>17.25 && f$srai<=17.75 ? 17.50 :
f$srai>17.75 && f$srai<=18.25 ? 18.00 :
f$srai>18.25 && f$srai<=18.75 ? 18.50 :
f$srai>18.75 && f$srai<=19.25 ? 19.00 :
f$srai>19.25 && f$srai<=19.75 ? 19.50 :
f$srai>19.75 && f$srai<=20.25 ? 20.00 :

f$srai>20.25 ? f$srai : 0


This is working fine till NL10
newbee
Full House
 
Posts: 226
Joined: 2008 Jun 27 Fri 5:26:43 am
Location: The Netherlands


Return to Rules and Named Formulas

Who is online

Users browsing this forum: No registered users and 1 guest