20 minutes ago, Rodolfo Carvalho wrote:
>
> (define (pythagorean-triple/alt n)
> (for*/first ([a (in-range 1 n)]
> [b (in-range a n)]
> [c (in-value (- n a b))]
> #:when (right-triangle? a b c))
> (list a b c)))
You can also use `for*/or':
(d
Hi Joe,
On Mon, Mar 19, 2012 at 01:44, Joe Gilray wrote:
> Hi, I created the following code from some scheme I found on
> ProjectEuler.net (problem #9):
>
> (define (right-triangle? a b c)
> (= (+ (* a a) (* b b)) (* c c)))
>
> -snip-
>
Thoughts?
>
>
When I saw your code it made me think of
Hi, I created the following code from some scheme I found on
ProjectEuler.net (problem #9):
(define (right-triangle? a b c)
(= (+ (* a a) (* b b)) (* c c)))
(define (pythagorean-triple n)
(let loop-a ([a 1])
(let loop-b ([b (add1 a)])
(let ([c (- n a b)])
(if (<= c b)
This is all wrong even though 'it works' :-) [[see my homepage]]
1. You need to agree on one set of possible worlds? What states can the world
be in? What kind of data describes these states?
Call this set of data WORLD.
2. Then you need to design three functions with the following signatur
> Followup: "quickselect" is the name of this:
>
>
http://en.wikipedia.org/wiki/Selection_algorithm#Partition-based_general_selection_algorithm
Hi Jens,
I've coded this algorithm up with a few minimal test cases:
https://github.com/dyoo/quick-select
It should do the trick, though you'll need
The improvement is not due to the nested result but the string-based
palindromic? function.
For the advantages of nested defines, see the draft of the Style Guide:
http://www.ccs.neu.edu/home/matthias/Style/style/index.html
-- Matthias
On Mar 18, 2012, at 2:57 AM, Racket Noob wrote:
> Wh
On Sunday, March 18, 2012, Racket Noob wrote:
> Which leads to question: when to use nested define and when to use let?
Contemporary Racket coding style prefers nested defines. See Section 4.2
of:
http://www.ccs.neu.edu/home/matthias/Style/style/
Racket Users list:
h
Hello, I have this programm : ; WorldState -> WorldState; the clock ticked; decrease the gauge with 0.1; example:; given: 20, expected 19.9; given: 78, expected 77.9(define (tock ws) (if (> ws 0) (- ws 0.1)0 )); GaugeState -> Gaugestate. ; display the gauge.(define (gauge ws) (overlay/xy (rectan
On Sun, 2012-03-18 at 14:38 -0400, jkaczo...@aol.pl wrote:
> Could anyone explain me how to create objects and their instances?
> [...]
Hello,
first you have to create a class. An empty class definition might look
like this:
(define foo%
(class object%
(super-new)))
Note that a
On Sun, 2012-03-18 at 14:38 -0400, jkaczo...@aol.pl wrote:
> Could anyone explain me how to create objects and their instances?
> [...]
Hello,
first you have to create a class. An empty class definition might look
like this:
(define foo%
(class object%
(super-new)))
Note that a clas
Could anyone explain me how to create objectsand their instances?
I've read of course the racket guide and reference but the examples I
foundthere are (for me) completely useless:
I'm not interested in how to create class hierarchies. The only thing I want
toknow is
how to create a class and how
On Sat, Mar 17, 2012 at 02:02:22PM -0700, Mark Engelberg wrote:
>
> semi-literate-programming seems an apt name.
>
> I don't think Javadoc would even qualify for that label though. In my
> mind, "semi-literate" at least implies a focus on building a narrative
> exposition of why the functions wo
Which leads to question: when to use nested define and when to use let?
> From: matth...@ccs.neu.edu
> Date: Sun, 11 Mar 2012 19:14:38 -0400
> To: jgil...@gmail.com
> CC: users@racket-lang.org; jus...@zamora.com
> Subject: Re: [racket] spirit of Racket?
>
>
> I believe the code below cuts your
Please let me know if you have any comments on the
non-backward-compatible changes I'm about to make to "html-template"
("http://www.neilvandyke.org/racket-html-template/";)."
Most of the visible changes to the "html-template" syntax is completely
changing all the "%"-something parts of the te
2012/3/17 Neil Van Dyke :
> Jens Axel Søgaard wrote at 03/17/2012 09:17 AM:
>
>> Is it possible to display pdfs in snips without converting them to
>> bitmaps?
> You might be able to implement this using Poppler.
> http://en.wikipedia.org/wiki/Poppler_%28software%29
Looks like Poppler is the way
Hi all,
I've implemented the 'pfannkuchen' algorithm for the fannkuch-redux benchmark
on shootout.alioth.debian.org, since this is the only remaining benchmark
without a Racket attempt. It seemed like a fun newbie project.
I'd appreciate any optimization hints or general comments and criticism
16 matches
Mail list logo