From: Stas Miasnikou <stas.miasnikou@gmail.com>
To: "C. Fr" <newsgroups.fr@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Building a game loop (sort of)
Date: Sun, 21 Mar 2010 23:26:51 +0200 [thread overview]
Message-ID: <36ae71be1003211426h1aab13f7oc76b4e1ae8d7b386@mail.gmail.com> (raw)
In-Reply-To: <4ba68bb6.1090cc0a.4f26.ffffcf74@mx.google.com>
On 3/21/10, C. Fr <newsgroups.fr@gmail.com> wrote:
> I’m building a small fractal visualisation app in ocaml, but I encounter
> many problems with the graphics package.
>
> First, plot (size_x / 2) (size_y / 2) doesn’t actually plot in the middle of
> the screen… Any idea why?
What are size_x and size_y, what you got, and what you are supposed to get?
> Then, using the following code
>
> if key_pressed () then
> begin
> match read_key () with
> | 'q' -> raise Exit
> | 'o' -> scale := !scale *. 2.
> | 'i' -> scale := !scale /. 2.
> | 'l' -> mid_x := !mid_x + 100
> | 'r' -> mid_x := !mid_x - 100
> | 'u' -> mid_y := !mid_y + 100
> | 'd' -> mid_y := !mid_y - 100
> | _ -> ()
> end
> done;
>
> in a while true loop behaves randomly, ignoring some key presses, and
> repeating some… Is there something that I did wrong?
Stas
next prev parent reply other threads:[~2010-03-21 21:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-21 21:12 C. Fr
2010-03-21 21:26 ` Stas Miasnikou [this message]
2010-03-22 0:04 ` [Caml-list] " Yang Ye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=36ae71be1003211426h1aab13f7oc76b4e1ae8d7b386@mail.gmail.com \
--to=stas.miasnikou@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=newsgroups.fr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).