Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22443 > unrolled thread

BlueJ don't know what i did wrong

Started byBlueJguywithoutskill <marvin.radke@htp-tel.de>
First post2013-02-22 06:03 -0800
Last post2013-02-24 12:38 -0800
Articles 6 on this page of 46 — 10 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  BlueJ don't know what i did wrong BlueJguywithoutskill <marvin.radke@htp-tel.de> - 2013-02-22 06:03 -0800
    Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-22 15:55 +0100
    Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-22 07:13 -0800
      Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-22 16:24 +0100
        Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-22 07:31 -0800
        Re: BlueJ don't know what i did wrong Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-22 10:50 -0500
    Re: BlueJ don't know what i did wrong markspace <markspace@nospam.nospam> - 2013-02-22 10:43 -0800
    Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-24 02:27 -0800
      Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-24 14:54 +0100
        Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-24 06:15 -0800
      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-24 15:04 +0000
      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-24 16:29 +0000
        Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-24 18:21 +0100
          Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-24 17:43 +0000
            Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-24 20:04 +0100
              Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-24 19:24 +0000
                Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-25 01:52 -0800
                  Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-25 11:10 +0000
                    Re: BlueJ don't know what i did wrong "John B. Matthews" <nospam@nospam.invalid> - 2013-02-25 07:50 -0500
                      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-25 13:35 +0000
                        Re: BlueJ don't know what i did wrong "John B. Matthews" <nospam@nospam.invalid> - 2013-02-25 13:52 -0500
                          Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-25 19:54 +0000
                            Re: BlueJ don't know what i did wrong Lew <lewbloch@gmail.com> - 2013-02-25 14:26 -0800
                              Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-26 09:08 +0000
                            Re: BlueJ don't know what i did wrong Arne Vajhøj <arne@vajhoej.dk> - 2013-02-25 22:05 -0500
                            Re: BlueJ don't know what i did wrong Arne Vajhøj <arne@vajhoej.dk> - 2013-02-25 22:08 -0500
                              Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-26 09:23 +0000
                                Re: BlueJ don't know what i did wrong Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-26 05:59 -0400
                                  Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-26 11:30 +0000
                                    Re: BlueJ don't know what i did wrong Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-27 06:45 -0400
                                      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-27 11:58 +0000
                                      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-27 12:24 +0000
                                        Re: BlueJ don't know what i did wrong Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-27 22:40 -0400
                                          Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-28 08:53 +0000
                                            Re: BlueJ don't know what i did wrong Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-28 17:14 -0400
                                              Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-01 08:45 +0000
                                  Re: BlueJ don't know what i did wrong markspace <markspace@nospam.nospam> - 2013-02-26 08:33 -0800
                            Re: BlueJ don't know what i did wrong Arne Vajhøj <arne@vajhoej.dk> - 2013-02-25 22:19 -0500
                        Re: BlueJ don't know what i did wrong Arne Vajhøj <arne@vajhoej.dk> - 2013-02-25 22:02 -0500
                    Re: BlueJ don't know what i did wrong marvin.radke@htp-tel.de - 2013-02-25 09:54 -0800
                      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-25 18:25 +0000
                    Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-26 16:13 +0100
                      Re: BlueJ don't know what i did wrong lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-26 16:40 +0000
                        Re: BlueJ don't know what i did wrong Joerg Meier <joergmmeier@arcor.de> - 2013-02-26 18:19 +0100
                  Re: BlueJ don't know what i did wrong markspace <markspace@nospam.nospam> - 2013-02-25 08:34 -0800
      Re: BlueJ don't know what i did wrong Lew <lewbloch@gmail.com> - 2013-02-24 12:38 -0800

Page 3 of 3 — ← Prev page 1 2 [3]


#22510

Fromlipska the kat <"nospam at neversurrender dot co dot uk">
Date2013-02-25 18:25 +0000
Message-ID<LZqdnSNTHPwoMbbMnZ2dnUVZ8q2dnZ2d@bt.com>
In reply to#22508
On 25/02/13 17:54, marvin.radke@htp-tel.de wrote:

[snip]

>
> well i read the few things on the link and it seems like it could help, but through we only had very basic things in school, i don't know how to populate this stack... do i just have to insert vectors into it?

You need to understand how a Stack works

To put an item on the Stack you use the push(item) method

To remove the top item from the stack you use the pop() method
once you've 'popped' an item it is no longer on the stack, you don't 
need to 'count' anything, when it's popped it's gone.

Read this

http://en.wikipedia.org/wiki/Stack_%28abstract_data_type%29

Let us know how you get on.

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun

[toc] | [prev] | [next] | [standalone]


#22531

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-02-26 16:13 +0100
Message-ID<743qp5x1pcgm.1ctnh8jj9stlu$.dlg@40tude.net>
In reply to#22501
On Mon, 25 Feb 2013 11:10:49 +0000, lipska the kat wrote:

> Do you know what a stack is ?

Not to put fuel on the fire that is going on elsewhere in the thread, but
it seems to me that Stack/Deque is a bad choice for this, as he needs
random access (because certain units are helped by certain specific other
ones). A map where the helper-reference is the key would imo be the best
choice, with something like 

Object[] keys = unitMap.keySet().toArray(); 
Unit unit = (Unit) unitMap.remove(keys[rng.nextInt(keys.length)]); 

for random access. While obviously this doesn't scale terribly well, in
this use case it doesn't have to, and it's a nice concise way for doing
things.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#22540

Fromlipska the kat <"nospam at neversurrender dot co dot uk">
Date2013-02-26 16:40 +0000
Message-ID<gKSdnefapvb0eLHMnZ2dnUVZ8qidnZ2d@bt.com>
In reply to#22531
On 26/02/13 15:13, Joerg Meier wrote:
> On Mon, 25 Feb 2013 11:10:49 +0000, lipska the kat wrote:
>
>> Do you know what a stack is ?
>
> Not to put fuel on the fire that is going on elsewhere in the thread, but
> it seems to me that Stack/Deque is a bad choice for this, as he needs
> random access (because certain units are helped by certain specific other
> ones). A map where the helper-reference is the key would imo be the best
> choice,

Yes, I've been thinking about this, you're right, a Stack probably 
wouldn't be the answer. I was thinking 'cards, deck, (no not deque :-) 
stack but as time allows I'm trying to get something working given the 
rather sparse information to date. I have never played these 'adventure' 
type games ('bubble bobble' with my daughter is about my level). It 
would be nice to have a spec.

> with something like. Object[] keys = unitMap.keySet().toArray();
> Unit unit = (Unit) unitMap.remove(keys[rng.nextInt(keys.length)]);

Yea, there needs to be a way of determining if the 'whatever' is there 
or if it's been used I think. I presume you would test for null but we 
might end up with the same problem the 'thereness' or not is being used 
all over the place in conditional tests, I think this just needs to 
happen once, probably, anyway ... too busy with other stuff at the 
moment to investigate further.

Like:
get the example sitemap from google webmaster tools and test it with the 
recommended validator and ... epic fail :-(

meh

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun

[toc] | [prev] | [next] | [standalone]


#22543

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-02-26 18:19 +0100
Message-ID<br3twx3u42j9$.5xwjhfpzp47i$.dlg@40tude.net>
In reply to#22540
On Tue, 26 Feb 2013 16:40:06 +0000, lipska the kat wrote:

> On 26/02/13 15:13, Joerg Meier wrote:
>> with something like. Object[] keys = unitMap.keySet().toArray();
>> Unit unit = (Unit) unitMap.remove(keys[rng.nextInt(keys.length)]);
> Yea, there needs to be a way of determining if the 'whatever' is there 
> or if it's been used I think. I presume you would test for null but we 
> might end up with the same problem the 'thereness' or not is being used 
> all over the place in conditional tests, I think this just needs to 
> happen once, probably, anyway ... too busy with other stuff at the 
> moment to investigate further.

Yes - .remove actually removes the object, so once a card is taken from the
deck, it's gone completely from the map. No need to write that down
anywhere. If for whatever reason you merely wanted to test for it, there is
always .contains().

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#22505

Frommarkspace <markspace@nospam.nospam>
Date2013-02-25 08:34 -0800
Message-ID<kgg3o7$nt6$1@dont-email.me>
In reply to#22500
On 2/25/2013 1:52 AM, marvin.radke@htp-tel.de wrote:
> well.. the game is like said a tabletop game with many units which
> are grouped on cards. And this cards i want to give to the players, 3
> cards are 2 times available thats why i did it like this....


If I understand what you are saying, then why not just add those cards 
to the deck twice?  It's easier than keeping track of all cards in a 
separate structure.

[toc] | [prev] | [next] | [standalone]


#22486

FromLew <lewbloch@gmail.com>
Date2013-02-24 12:38 -0800
Message-ID<c4a7f3a3-a02e-47ab-8e39-e95c4527d55f@googlegroups.com>
In reply to#22476
marvin...@htp-tel.de wrote:
> I hope that is what you meant by making it easierr to read: 

You tell us. Is that easy to read?

> public class RandomFigures 
> {
>    public String [] Name; 

Follow the naming conventions. Also, you'll learn that members like this 
should be 'private' with methods to get ('getName()') and set ('setName()') 
the attributes.

>    public int [] points; 
>    public int [] assisting; 
>    public int [] help; 
>    public int [] helpstillyet; 
>    public int [] stillthere; 
>    ...

Parallel arrays are not the data structure you should use. The correlation 
between these arrays and their meanings are not enforced. A class is supposed 
to collect correlated information. Also, follow the Java naming conventions.

So:

public class RandomFigure 
{
  private String name; 
  private int point; 
  private int assisting; 
  private int help; 
  private int helpStillYet; 
  private int stillThere; 

  public RandomFigure( String name, int point, int assisting, int help, 
                        int helpStillYet, int stillThere )
  {
    this.name = name; 
    this.point = point; 
    this.assisting = assisting; 
    this.help = help; 
    this.helpStillYet = helpStillYet; 
    this.stillThere = stillThere; 
  }
    ... // getXxx() and setXxx() methods
}

Then you can have an array of these correlated attribute things:

  RandomFigure [] figures = new RandomFigure [160]; // or whatever magic number
  RandomFigure [0] = 
    new RandomFigure( "Cyprien Esenwein", 150, -1, -1, -1, -1);
etc.

Just a start.

-- 
Lew

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.java.programmer


csiph-web