[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: beyond fizzbuzz to NBA stats! compute point per shot! clisp problem please post an answer

endlessboomcapitalism

6/15/2016 7:34:00 PM

On Friday, June 10, 2016 at 1:03:42 PM UTC-4, endlessboo...@gmail.com wrote:
> I like basketball.
>
> I love to use awk to compute point per shot.
>
> The point per shot is points per game divided by field goal and half free throw attempts.
>
> I notice that Kevin McHale has a very high point per shot.
>
> http://www.basketball-reference.com/players/m/mcha...
>
> see section "per game" stats, and I copy into file named mchale.
>
> I had to remove the * star next to some rows in column one manually in vi editor.
>
> There are also some blanks for 3p% that I filled in with 0 in row for 82 86 and 88.
>
> Once all the rows are filled and each column is not blank and free of stars.
>
> Now awk can compute the point per shot, print the year, and sort -rn can sort:
>
> $ awk '{print $30/($10+($20/2)), $1}' mchale |sort -rn
> 1.28571 1986-87
> 1.28409 1987-88
> 1.22222 1989-90
> 1.21714 1985-86
> 1.21101 1984-85
> 1.19481 1990-91
> 1.19048 1988-89
> 1.17949 1983-84
> 1.12351 1982-83
> 1.11475 1981-82
> 1.10497 1980-81
> 1.0902 1991-92
> 1.02392 1992-93
>
>
> This shows a very high point per shot for mchale. Chris Mullin, Adrian Dantley, Darryl Dawkins are also very high in this stat. A few years ago i did this for Tim duncan tony parker and manu ginobi, and they were all much higher than kobe.
>
>
> How would you do this in clisp? or sbcl?
> thx

I guess lisp is awkward at text from a file manipulations?
1 Answer

taruss

6/16/2016 12:20:00 AM

0

On Wednesday, June 15, 2016 at 12:33:41 PM UTC-7, endlessboo...@gmail.com wrote:
>
> I guess lisp is awkward at text from a file manipulations?

Not if you use the libraries that are available.

Start here: http://cli...