#213493 - 2018-07-03 04:50 PM
Re: Kixgolf - Magic (Private Round)
[Re: Stoke]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
Well thats annoying.... missed the required If a == b part etc
and not entirely sure my solution is allowed for the set of rules....
KiXtart Version = 4.67
KiXGolf Script = kixgolf_magic.KIX
Scoring Engine = 3.3
OS = Windows 10.0 / 161
CPU = Intel Pentium Model 15
Speed = 3592 MHz
Memory = 65536 MB
Tournament = Magic 11-16
Processing Start = 2018/07/03 16:47:35.986
Processing End = 2018/07/03 16:47:35.996
Duration = 0000/00/00 00:00:00.010
# Tests Run = 19
# Tests Passed = 19
# Tests Failed = 0
Result = Passed
KiXGolf Score = 192
Thank you for participating in KiXtart Golf!
|
Top
|
|
|
|
#213496 - 2018-07-04 09:01 AM
Re: Kixgolf - Magic (Private Round)
[Re: Allen]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
Allen i'm up for that if Lonkero is up for that as well. In the meanwhile i managed to break away a bit more code
I
KiXtart Version = 4.67
KiXGolf Script = kixgolf_magic.KIX
Scoring Engine = 3.3
OS = Windows 10.0 / 161
CPU = Intel Pentium Model 15
Speed = 3592 MHz
Memory = 65536 MB
Tournament = Magic 11-16
Processing Start = 2018/07/04 09:00:01.175
Processing End = 2018/07/04 09:00:01.184
Duration = 0000/00/00 00:00:00.009
# Tests Run = 19
# Tests Passed = 19
# Tests Failed = 0
Result = Passed
KiXGolf Score = 191
II Still calculating both numbers but without the comparison check in the end.
KiXtart Version = 4.67
KiXGolf Script = kixgolf_magic.KIX
Scoring Engine = 3.3
OS = Windows 10.0 / 161
CPU = Intel Pentium Model 15
Speed = 3592 MHz
Memory = 65536 MB
Tournament = Magic 11-16
Processing Start = 2018/07/04 14:29:30.128
Processing End = 2018/07/04 14:29:30.138
Duration = 0000/00/00 00:00:00.010
# Tests Run = 19
# Tests Passed = 19
# Tests Failed = 0
Result = Passed
KiXGolf Score = 175
Thank you for participating in KiXtart Golf!
Edited by Stoke (2018-07-04 02:31 PM)
|
Top
|
|
|
|
#213517 - 2018-07-09 09:45 AM
Re: Kixgolf - Magic (Private Round)
[Re: Lonkero]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
I guess the public phase has started?
|
Top
|
|
|
|
#213520 - 2018-07-09 05:06 PM
Re: Kixgolf - Magic (Private Round)
[Re: Lonkero]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
-I-
function a($r,$p)
dim $t,$q,$,$b
$r = Join(Split($r,'10'),'K')
$t=36
While $r
$ = Asc($r)
$ = Iif($ > 65,10, $ & 15)
$r = right($r,-24 + $*2)
$q = $q + 1
If Ascan(Split($p,' '), $q) + 1
$t = $t - 12 + $
$b = $b + $
If $t == $b
$a = $t
endfunction
-II-
function a($r,$p)
dim $t,$q,$
$r = Join(Split($r,'10'),'K')
$t=36
While $r
$ = Asc($r)
$ = Iif($ > 65,10, $ & 15)
$r = right($r,-24 + $*2)
$q = $q + 1
If Ascan(Split($p,' '), $q) + 1
$t = $t - 12 + $
$a = $a + $
endfunction
Edited by Stoke (2018-07-09 05:06 PM)
|
Top
|
|
|
|
#213522 - 2018-07-10 12:45 AM
Re: Kixgolf - Magic (Private Round)
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
ok, here be my 192:
function a($,$b)
dim $c, $x, $f, $v
;$c - current card
;$v - the subject knowledge
;$ - original stack of 52 cards, inside for each used to count cards in current stack
;$x - count of stacks this far
;$f - first card in a new stack
$a = 36 ;52 cards - 16
for each $c in split($)
if 0=$f ;no cards in stack yet, get the face value of the first card
$f = 10*(1>$c)+$c-9*('A'=$c) ;case sensitive 199 code has this: ('a'=$c | 'A'=$c) ;value of first card. you could also use ucase() but it doesn't look as good.
$ = 0 ;new stack
endif
$ = 1+$ ;add a card to the current stack
if 12=$+$f ; is same as 11 = count of cards in stack minus one plus first card value
$x = 1 + $x ;another card stack on da table
if 1+ascan(split($b),$x) ;if this is one of the stacks the mark selected
$a = $a - $ ;magician removes from the count of cards, the amount of cards $ in the stack that the subject selected
$v = $v + $f ;subject selects their stack and sees the face value of $
endif
$f = 0 ;start a new stack
endif
next
if $a^$v ;if our calculated sum $a does not match to the sum of marks cards $v, return 0. never will happen so kinda pointless ;)
$a=0
endfunction
_________________________
!download KiXnet
|
Top
|
|
|
|
#213524 - 2018-07-11 10:26 AM
Re: Kixgolf - Magic (Private Round)
[Re: Lonkero]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
For 187
function a($r,$p)
;$r input card order
;$p input chosen piles
dim $t,$q,$,$b
;$t countdown from 52 cards
;$q current pile number
;$ holds value of current card
;$b sum of values of chosen pile card values
$r = Join(Split($r,'10'),'K') ; replaces all 10s bij K to make sure every 2 positions there is 1 card value in every 2 positions
$t=36 ;since we have to ignore 16 cards of the leftover cards 52 - 16
While $r
$ = Asc($r)
$ = Iif($ > 65,10, $ & 15) ;gets the current pile card value
$r = right($r,-24 + $*2) ;removes cards from card order
$q = $q + 1 ;move to next pile (start at 0)
If Ascan(Split($p), $q) + 1 ;check wether the current pile is one of the chosen ones
$t = $t - 12 + $ ;remove the cards from the leftover cards
$b = $b + $ ;add the current value to the chosen pile sum
If $t == $b ;if both calculations match then set the output (since one counts up and the other counts down this is always the last iteration
$a = $t
endfunction
Edited by Stoke (2018-07-11 10:29 AM)
|
Top
|
|
|
|
#213525 - 2018-07-11 03:57 PM
Re: Kixgolf - Magic (Private Round)
[Re: Stoke]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
NICE! thanks for the comments!
ok, so 183:
function a($r,$p)
;$r input card order
;$p input chosen piles
dim $t,$q,$,$b
;$t countdown from 52 cards
;$q current pile number
;$ holds value of current card
;$b sum of values of chosen pile card values
$r = Join(Split($r,10),K) ; replaces all 10s bij K to make sure every 2 positions there is 1 card value in every 2 positions
$t=36 ;since we have to ignore 16 cards of the leftover cards 52 - 16
While $r
$ = Asc($r)
$ = Iif($ > 65,10, $ & 15) ;gets the current pile card value
$r = right($r,-24 + $*2) ;removes cards from card order
$q = $q + 1 ;move to next pile (start at 0)
If Ascan(Split($p), $q) + 1 ;check wether the current pile is one of the chosen ones
$t = $t - 12 + $ ;remove the cards from the leftover cards
$b = $b + $ ;add the current value to the chosen pile sum
If $t == $b ;if both calculations match then set the output (since one counts up and the other counts down this is always the last iteration
$a = $t
endfunction
_________________________
!download KiXnet
|
Top
|
|
|
|
#213530 - 2018-07-12 01:45 AM
Re: Kixgolf - Magic (Private Round)
[Re: Lonkero]
|
Stoke
Fresh Scripter
Registered: 2014-07-02
Posts: 15
Loc: Netherlands
|
178
function a($,$p)
;???
;$r input card order
;$p input chosen piles
dim $t,$q,$r,$b
;$t countdown from 52 cards
;$q current pile number
;$ holds value of current card
;$b sum of values of chosen pile card values
$ = Join(Split($,10),K) ; replaces all 10s bij K to make sure every 2 positions there is 1 card value in every 2 positions
$t=36 ;since we have to ignore 16 cards of the leftover cards 52 - 16
While $
$r = 10*(1>$)+$-9*(65=asc($)) ;gets the current pile card value
$ = right($,$r*2-24) ;removes cards from card order
$q = $q + 1 ;move to next pile (start at 0)
If Ascan(Split($p), $q) + 1 ;check wether the current pile is one of the chosen ones
$t = $t - 12 + $r ;remove the cards from the leftover cards
$b = $b + $r ;add the current value to the chosen pile sum
If $t = $b ;if both calculations match then set the output (since one counts up and the other counts down this is always the last iteration
$a = $t
endfunction
p.s. Page is currently broken when trying to view this with javascript on.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|