Page 5 of 9 « First<34567>Last »
Topic Options
#178247 - 2007-07-23 09:25 PM Re: KiXgolf Freebie: Quicksum [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
HEHEE!!!
 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_qs.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 13
Speed = 1861 MHz
Memory = 1014 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Quicksum
Processing Start = 2007/07/23 22:26:29.765
Processing End = 2007/07/23 22:26:29.781
Duration = 0000/00/00 00:00:00.016
KiXGolf Score = 79
_________________________
!

download KiXnet

Top
#178248 - 2007-07-23 09:26 PM Re: KiXgolf Freebie: Quicksum [Re: Benny69]
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Benny69, I have no idea why that works

What is going on?

I guess the left($,~) is some sort of walk through the string...

But I just can't see how this works. Any chance of an explination?
_________________________
Every day is a school day

Top
#178249 - 2007-07-23 09:26 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
I still think we can get below 80...

[edit/rant: I knew it! Dang it Jooel!!! [/rant]


Edited by Allen (2007-07-23 09:28 PM)

Top
#178250 - 2007-07-23 09:30 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
... Looking forward to it

but I'll have to go soon (back tomorrow). What happens now? how long does this section continue and when do I need to post code for validation?

sorry for ht enewbie quesitons, but I'm a newbie at kixgolf ;\)
_________________________
Every day is a school day

Top
#178251 - 2007-07-23 09:30 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
btw, just to show different type of code...
 Code:
Function a($b)
dim $
for $=1 to len($b)
 $a=$a+$*split(asc(substr($b,$))-64,"-")[0]
EndFunction


I still hope someone can get rid of the dim totally.
doesn't look nice ;\)

anyways, this array way was 85.
_________________________
!

download KiXnet

Top
#178252 - 2007-07-23 09:35 PM Re: KiXgolf Freebie: Quicksum [Re: Lonkero]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
acmp,
left($,~) chops off the right most chr so ACM becomes AC, then it is sent back into the loop and then i am calling the function to create the count down a(left($,~))


Edited by Benny69 (2007-07-23 09:38 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#178253 - 2007-07-23 09:41 PM Re: KiXgolf Freebie: Quicksum [Re: Benny69]
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Thanks Benny69
_________________________
Every day is a school day

Top
#178255 - 2007-07-23 09:45 PM Re: KiXgolf Freebie: Quicksum [Re: acmp]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
$a=$a+$*split(asc(substr($b,$))-64,"-")[0]

Jooel... you are one smart basta! Seeing this... I know 79 can be beat too.... just got to figure it out before you do!

Top
#178256 - 2007-07-23 09:46 PM Re: KiXgolf Freebie: Quicksum [Re: Benny69]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
~ is not operator or something.
figured in some previous kixgolf tournament that one can use it as -1 in some cases.

that is, if your parameter has nothing else, NOT-inversion from nothing becomes true, which translates to -1.

and that's 1 stroke shorter than saying left($,-1) \:\)
_________________________
!

download KiXnet

Top
#178257 - 2007-07-23 09:47 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Jeez Don't log in for a day and look what happens... If work ever slows down I might get to try...
_________________________
Today is the tomorrow you worried about yesterday.

Top
#178258 - 2007-07-23 09:54 PM Re: KiXgolf Freebie: Quicksum [Re: Gargoyle]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
k, if someone shortens my 79, be my guest.
I can't keep on thinking about this, otherwise my sudoku time gets shrinked too much.

 Code:
Function a($)
dim $b
while $
 $b=$b+1
 $a=$a+$b*(asc($)-64)*($>#)
 $=right($,~)
EndFunction
_________________________
!

download KiXnet

Top
#178259 - 2007-07-23 09:57 PM Re: KiXgolf Freebie: Quicksum [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
Jooel... Here is your 85 down to 83/82

 Code:
Function a($)
dim $b
for $b=1 to 0^$
 $a=$a+$b*split(asc(substr($,$b))-64,"-")[0]
EndFunction

Top
#178260 - 2007-07-23 09:57 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
And here is my 82/81

 Code:
Function a($)
  dim $b
  if $
    $b=asc(right($,1))-64
    $a=a(left($,~))+($b>)*$b*(0^$)
  ;endif
EndFunction

Top
#178261 - 2007-07-23 10:03 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
wow Allen, ours is very similar
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#178262 - 2007-07-23 10:05 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
ugghhh....Must pull away from computer... must work.... (dang golf!)
Top
#178264 - 2007-07-23 10:07 PM Re: KiXgolf Freebie: Quicksum [Re: Allen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
here is 81:
 Code:
Function a($)

  dim $b
  if $
    $b=asc(right($,1))-64
    $a=a(left($,~))+($b>)*$b*($^)
		
EndFunction
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#178265 - 2007-07-23 10:11 PM Re: KiXgolf Freebie: Quicksum [Re: Benny69]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
nice... I never thought of that...

here is my other entry with your genius:

83/82
 Code:
Function a($)
  dim $i,$b
  for $i=1 to $^
    $b=asc(substr($,$i))-64
    if $b>0
      $a=$a+$i*$b
    ;endif
  ;next
EndFunction

Top
#178266 - 2007-07-23 10:12 PM Re: KiXgolf Freebie: Quicksum [Re: Benny69]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Wonder why nobody has thought of this yet ....

Here's my 81

 Code:
Function a($i)
    dim $, $_
    for $ = 1 to 255
        $_ = asc(substr($i,$))-64
        $a = $a + $ * $_ * ($_>)
;    next
EndFunction
_________________________



Top
#178267 - 2007-07-23 10:25 PM Re: KiXgolf Freebie: Quicksum [Re: Jochen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
hey, is this a bug:
 Code:
Function a($i)
    dim $, $_
    for $ = 1 to 0
        $_ = asc(substr($i,$))-64
        $a = $a + $ * $_ * ($_>)
;    next
EndFunction


the for loop should run from 1 to upperlimit of int and then start from negative end and finally stop at 0.
but, instead, it does not go to the loop at all!?!?
_________________________
!

download KiXnet

Top
#178268 - 2007-07-23 10:27 PM Re: KiXgolf Freebie: Quicksum [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4510
Loc: USA
If I understand you correctly, I don't think I've ever been able to get it to increment negatively without putting a step -1.
Top
Page 5 of 9 « First<34567>Last »


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

Who's Online
0 registered and 211 anonymous users online.
Newest Members
dimi575, Drecksnacken, Nlill, webtools321, multiman
17734 Registered Users

Generated in 0.045 seconds in which 0.014 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