Wikipedia:Reference desk/Archives/Computing/2013 December 14

= December 14 =

Jython programming
I'm investigating the makeEmptyPicture function in jython for an assignment which is due shortly. If anybody knows how to incorporate the function into some scripting to do with assigning numbers to produce a picture, please let me know.

Thanks David Smith 14/12/2013. 15:44 Thesmithster (talk) 05:24, 14 December 2013 (UTC)


 * It sounds like you're using Jython Environment for Students. Some simple graphical code for JES is here. -- Finlay McWalterჷTalk 13:10, 14 December 2013 (UTC)

Stuck on a Java problem
I'm trying to finish up a game of the card game War with Java. I'm getting the following error when I try to run the program and I don't know why. Could someone help me understand why this is happening?

The relevant portions of code are here:

Thanks, Dismas |(talk) 06:08, 14 December 2013 (UTC)
 * Java arrays are zero-based, and the highest index is therefore the length minus one. You have an array of 52 objects, which have indices 0 through 51. The line  will therefore throw an exception when   has value 51.  J I P  &#124; Talk 07:33, 14 December 2013 (UTC)


 * Thanks! I changed  to   and that seems to have fixed the issue.  Dismas |(talk) 07:44, 14 December 2013 (UTC)


 * You could just deal the cards from the end of the array—then you wouldn't need that loop at all. That's the usual way of implementing a stack in an array. -- BenRG (talk) 08:37, 14 December 2013 (UTC)


 * And just do something like this?
 * Card c = _deck[_deck.length];
 * return c;
 * I suppose I could. It's working the way I have it now though.  Maybe if I get it working completely, I'll go back and make it cleaner.  Right now I have it playing the first 26 hands and then failing when it goes to move the discards back to the player's hands.  Dismas |(talk) 09:19, 14 December 2013 (UTC)

Annoying Google Chrome Message.
I have been using google chrome to explore the internet for a few years back.Everything was nice until a message started to appear whenever i started the chrome.The message is "Your preferences cannot be read. Some features may be unavailable and changes to preferences won't be saved." I searched for the solution on the net and tried many suggestions but nothing worked.I reinstalled Chrome, deleted User Data,changed permission settings and everything I could find. But the message is continuing to appear. Plz help.It is really annoying. — Preceding unsigned comment added by 113.199.235.40 (talk) 12:22, 14 December 2013 (UTC)