Page 3 of 4 <1234>
Topic Options
#213492 - 2018-07-03 04:37 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
The revised end date for the private round will now be this Sunday 7/8 12PM Eastern. I'll update the countdown clock when I have time.

As a reminder, you must solve both sides of the equation and compare them. See Notes above for further explanation.

Top
#213493 - 2018-07-03 04:50 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Stoke Offline
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....

 Code:
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
#213494 - 2018-07-03 06:56 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
for me the hard part was keeping the input1 and input2 calculations separate.

I might have to look at my code. don't like the fact that you have the same score.
_________________________
!

download KiXnet

Top
#213495 - 2018-07-04 12:40 AM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Okay... for fun, and if you so desire...

Code Challenge I: As described above in the instructions, comparing magician and subject values. If you have any question about your code passing the rules and or "cheating", just go ahead and consider it not passing.

Code Challenge II: Lowest score, no comparison.

Please *Visibly* mark posts by putting a I or II above your score.

Maybe this will open things up, and possibly find some stragglers who have yet to play (Glenn AND team, J, among others)

Points will be given for each challenge.

Top
#213496 - 2018-07-04 09:01 AM Re: Kixgolf - Magic (Private Round) [Re: Allen]
Stoke Offline
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
 Code:
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.
 Code:
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
#213501 - 2018-07-05 04:14 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Sorry, Guys - we had 3 clients close in the past two weeks in addition to my dev work for a project due in August. We're swamped, which is why I posted the "help wanted" request.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#213504 - 2018-07-05 10:27 PM Re: Kixgolf - Magic (Private Round) [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
help wanted?
_________________________
!

download KiXnet

Top
#213517 - 2018-07-09 09:45 AM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Stoke Offline
Fresh Scripter

Registered: 2014-07-02
Posts: 15
Loc: Netherlands
I guess the public phase has started?
Top
#213519 - 2018-07-09 04:23 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes, it did. I do not have my code at hand. I can post in about 7 hours.
_________________________
!

download KiXnet

Top
#213520 - 2018-07-09 05:06 PM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Stoke Offline
Fresh Scripter

Registered: 2014-07-02
Posts: 15
Loc: Netherlands
-I-
 Code:
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-
 Code:
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
#213521 - 2018-07-09 11:15 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
both of your functions are calculating against $p.
if $p is omitted from the input, does your code still work?

thinking about it again, my code might be doing something alike...
need to see once I get to that computer.


Edited by Lonkero (2018-07-09 11:30 PM)
_________________________
!

download KiXnet

Top
#213522 - 2018-07-10 12:45 AM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, here be my 192:

 Code:
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 Offline
Fresh Scripter

Registered: 2014-07-02
Posts: 15
Loc: Netherlands
For 187
 Code:
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 Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
NICE!
thanks for the comments!

ok, so 183:
 Code:
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
#213526 - 2018-07-11 04:25 PM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
180:
 Code:
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($,-24 + $r*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 + $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
_________________________
!

download KiXnet

Top
#213527 - 2018-07-11 04:30 PM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I am having trouble figuring out how this can work:
 Code:
$ = right($,-24 + $r*2) ;removes cards from card order
_________________________
!

download KiXnet

Top
#213528 - 2018-07-11 04:45 PM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
179:
 Code:
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
;		? (-24 + $r*2) " $r is: " $r " from string: " $
		$ = right($,-24 + $r*2) ;removes cards from card order
;		? " leaving: " $ ?
		$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
_________________________
!

download KiXnet

Top
#213529 - 2018-07-11 04:50 PM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this...
I don't think this part is kosher... consciously keeping track of both numbers and use them to get the result. this is equivalent of all cards being flipped face up so the magician can teach to mark how to do the trick:
 Code:
			If $ = $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
_________________________
!

download KiXnet

Top
#213530 - 2018-07-12 01:45 AM Re: Kixgolf - Magic (Private Round) [Re: Lonkero]
Stoke Offline
Fresh Scripter

Registered: 2014-07-02
Posts: 15
Loc: Netherlands
178

 Code:
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
#213533 - 2018-07-15 11:54 PM Re: Kixgolf - Magic (Private Round) [Re: Stoke]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
too much code. javascript is being killed by your browser as far as I understand it.
_________________________
!

download KiXnet

Top
Page 3 of 4 <1234>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.087 seconds in which 0.036 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org