Re: Games and Threads?!

From: Lara O. Delirio <lara.od_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 28 2009 - 18:41:40 MDT

*It would be very nice for sure, but I'm supose to do a minesweeper with
NCL. I'm going crazy trying to figure out how to do it.

 And thank you, Mary, for answering my question*

On Mon, Sep 28, 2009 at 3:07 PM, Don Morton <morton@arsc.edu> wrote:

> I won't bother the whole list with this reply, but I thought the idea of
> using NCL for a simple game was kind of interesting :)
>
> Granted, it's not a language designed for doing games, but one could
> imagine some sort of geography and/or climate weather game. Given the
> netCDF output of a weather forecast, for example, maybe a plot could be made
> of the isobars, and the program might prompt the user to determine where the
> precipitation is going to be, and then the next plot could be of the
> forecast precipitation.
>
> Again, I know there are better languages for doing this, but if you're
> supposed to be focusing on NCL, and you're supposed to do a game with it,
> well, it just might be possible :)
>
> Cheers,
>
> Don
>
> On Sep 28, 2009, at 9:58 AM, Mary Haley wrote:
>
>
> On Sep 27, 2009, at 6:10 PM, Lara O. Delirio wrote:
>
> * I'm doing a paper about NCL, and it is required to do a simple game,
> but I don't think that it is possible to do a interative game with the
> language. My question is if it's really a language to deal just with plots,
> maps and diagrams, or there ir a way to get user's input ?
> And the other is: Does NCL gives support to threads?*
> *
> thank you*
>
>
> Hi Lara,
>
> NCL is not really designed as an interactive language; that is, there's no
> way to prompt for user input directly from an NCL script.
>
> What most of our users do in this case is wrap a shell script around the
> NCL script, prompt for the user input, and then pass the user input to the
> NCL script via command line options:
>
> Here's a very simple example:
>
> Shell script:
>
> #!/bin/sh
>
> echo -n "Enter a floating point value: "
> read x
> echo -n "Enter a title (no quotes): "
> read title
>
> echo "x = $x"
> echo "title = $title"
>
> eval ncl x=$x \'title=\"$title\"\' your_script.ncl
>
> And here's what a simple "your_script.ncl" would look like, that accesses
> these variables:
>
> begin
> ; Instead of exiting, you could also provide a default value for 'x'.
> if(.not.isvar("x")) then
> print("No value provided for 'x'. Exiting")
> exit
> end if
>
> if(.not.isvar("title")) then
> print("No title provided. Exiting.")
> exit
> end if
>
> print("x = " + x)
> print("title = '" + title + "'")
>
> y = x * 100.
> print("y = x*100 = " + y)
>
> end
>
>
> NCL does not support threads, sorry.
>
> --Mary
>
>
> --
> Lara O. Delirio
> Percomp - Embedded
> Graduação Ciência da Computação
> Universidade Federal de Campina Grande
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ---
> Arctic Region Supercomputing Center
> http://www.arsc.edu/~morton/ <http://www.arsc.edu/%7Emorton/>
>
>
>
>
>
>

-- 
Lara O. Delirio
Percomp - Embedded (http://embedded.ufcg.edu.br/)
Graduação Ciência da Computação (http://www.ccc.ufcg.edu.br)
Universidade Federal de Campina Grande  (http://www.ufcg.edu.br/)
Received on Wed Oct 28 18:41:29 2009

This archive was generated by hypermail 2.1.8 : Mon Nov 02 2009 - 08:49:47 MST