This site requires JavaScript, please enable it in your browser!
Greenfoot back
SweetCaroline36
SweetCaroline36 wrote ...

2018/11/30

Greenfoot Terminal won't open. Tried previous solutions to no avail

SweetCaroline36 SweetCaroline36

2018/11/30

#
The greenfoot icon is open in my taskbar, but I can't see it on screen. I've tried moving it with shift click, doesn't work. I looked in properties as many other people have suggested and the x and y were at 16. I deleted them anyway like another suggestion said, and nothing changed. What do I do?
SweetCaroline36 SweetCaroline36

2018/11/30

#
I just noticed this is the case for only one program I'm working on. The others open just fine. I'm not sure if it's a code problem or what, so here's one of my classes. It's still in progress so pretty messy rn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.HashSet;
 
/**
 * Write a description of class MyWorld here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class MyWorld extends World
{
    public static int ybounds = 5;
    public static int xbounds = 5;
    public Square[][] sq = new Square[xbounds][ybounds];
    private HashSet<Square> blankChunk;
    public static int totalBombs = 0;
    public static int totalNotBombs;
    public MyWorld()
    {   
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(1500, 900, 1);
         
        for(int i = 0; i<xbounds; i++)
        {
            for(int j = 0; j<ybounds; j++)
            {
                sq[i][j] = new Square();
            }
        }
        blankChunk = new HashSet<Square>();
        setBombs();
        setAdj();
        setBlanks();
        //setAdjToBlank();
         
        totalNotBombs = (ybounds*xbounds) - totalBombs;
        //revealChunk();
        createMap();
         
    }
     
    public void createMap()
    {
        for(int i = 0; i<xbounds; i++)
        {
            for(int j = 0; j<ybounds; j++)
            {
                addObject(sq[i][j], i*100 + 50, j*100 + 50);
            }
        }
    }
     
    // public void revealChunk()
    // {
        // for(int i = 0; i<bounds; i++)
        // {
            // for(int j = 0; j<bounds; j++)
            // {
                // if(sq[i][j].adjacentToBlank)
                // {
                     
                // }
            // }
        // }
    // }
    public void revealChunk()
    {
        if(Square.clickedBlank)
        {
            for(int i = 0; i<xbounds; i++)
            {
                for(int j = 0; j<ybounds; j++)
                {
                     //if(sq[i][j].adjacentToBlank)
                     //{
                         //sq[i][j].setNumberImage();
                     //}
                }
            }
            
        }
    }
     
    public void setBombs()
    {
        for(int i = 0; i<xbounds; i++)
        {
            for(int j = 0; j<ybounds; j++)
            {
                if(Greenfoot.getRandomNumber(5) > 3)
                {
                    sq[i][j].setBomb();
                    totalBombs++;
                }
            }
        }
    }
    public void setAdj()
    {
        for(int i = 0; i<xbounds; i++)
        {
            for(int j = 0; j<ybounds; j++)
            {
                if(sq[i][j].isBomb)
                {
                    if(inBounds(i+1,j))
                    {
                       if(!sq[i+1][j].isBomb)
                       {
                           sq[i+1][j].setAdjacent();
                           sq[i+1][j].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i+1, j+1))
                    {
                       if(!sq[i+1][j+1].isBomb)
                       {
                           sq[i+1][j+1].setAdjacent();
                           sq[i+1][j+1].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i+1, j-1))
                    {
                       if(!sq[i+1][j-1].isBomb)
                       {
                           sq[i+1][j-1].setAdjacent();
                           sq[i+1][j-1].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i, j+1))
                    {
                       if(!sq[i][j+1].isBomb)
                       {
                           sq[i][j+1].setAdjacent();
                           sq[i][j+1].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i-1, j))
                    {
                       if(!sq[i-1][j].isBomb)
                       {
                           sq[i-1][j].setAdjacent();
                           sq[i-1][j].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i-1, j+1))
                    {
                       if(!sq[i-1][j+1].isBomb)
                       {
                           sq[i-1][j+1].setAdjacent();
                           sq[i-1][j+1].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i-1, j-1))
                    {
                       if(!sq[i-1][j-1].isBomb)
                       {
                           sq[i-1][j-1].setAdjacent();
                           sq[i-1][j-1].addBombAround();
                           //totalAdj++;
                       }
                    }
                    if(inBounds(i, j-1))
                    {
                       if(!sq[i][j-1].isBomb)
                       {
                           sq[i][j-1].setAdjacent();
                           sq[i][j-1].addBombAround();
                           //totalAdj++;
                       }
                    }
                }
            }
        }
    }
    public void setBlanks()
    {
        for(int i = 0; i<xbounds; i++)
        {
            for(int j = 0; j<ybounds; j++)
            {
                if(!sq[i][j].isBomb && !sq[i][j].isAdjacent)
                {
                    sq[i][j].setBlank();
                }
            }
        }
    }
    // public void setAdjToBlank()
    // {
        // for(int i = 0; i<xbounds; i++)
        // {
            // for(int j = 0; j<ybounds; j++)
            // {
                // if(sq[i][j].blank)
                // {
                    // if(inBounds(i+1,j))
                    // {
                       // if(!sq[i+1][j].blank)
                       // {
                           // sq[i+1][j].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i+1, j+1))
                    // {
                       // if(!sq[i+1][j+1].blank)
                       // {
                           // sq[i+1][j+1].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i+1, j-1))
                    // {
                       // if(!sq[i+1][j-1].blank)
                       // {
                           // sq[i+1][j-1].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i, j+1))
                    // {
                       // if(!sq[i][j+1].blank)
                       // {
                           // sq[i][j+1].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i-1, j))
                    // {
                       // if(!sq[i-1][j].blank)
                       // {
                           // sq[i-1][j].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i-1, j+1))
                    // {
                       // if(!sq[i-1][j+1].blank)
                       // {
                           // sq[i-1][j+1].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i-1, j-1))
                    // {
                       // if(!sq[i-1][j-1].blank)
                       // {
                           // sq[i-1][j-1].setAdjacentToBlank();
                       // }
                    // }
                    // if(inBounds(i, j-1))
                    // {
                       // if(!sq[i][j-1].blank)
                       // {
                           // sq[i][j-1].setAdjacentToBlank();
                       // }
                    // }
                // }
            // }
        // }
    // }
     
    public boolean inBounds(int r, int c)
    {
        if((r < 0 )||( c < 0 )||( r > xbounds-1 )||( c > ybounds-1))
        {
            return false;
        }
        else
        {
            return true;  
        }
    }
}
danpost danpost

2018/11/30

#
If on a Windows system, try hovering over task bar icon; then, move to mini-image and right click to select "Maximize".
You need to login to post a reply.