Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Best options for my card shuffling applet

 
Greenhorn
Posts: 6
Mac IntelliJ IDE Netbeans IDE TypeScript Redhat Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assessment:

Making a card deck with Card shuffling...
Downloaded already a cards pack from http://nifty.stanford.edu/2004/EstellCardGame/cards20.zip
How should I add the cards?

My code for now...
 
Marshal
Posts: 69847
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have already complained about applets, and you read that bit yourself.

Don't try any GUIs or anything like that until you have got the application working without a GUI. Do whatever you need to do with the cards in a console application first, then you can add a GUI.

I am not sure how useful that code you downloaded is going to be. You can find card symbols in Unicde here and here. Because some of those Unicode values are > 0xffff, you may have to do this sort of thing:-This is 1f0aa: 🂪. Unfortunately it doesn't seem to give you hearts/diamonds in red.
Find out about enumerated types from the Java™ Tutorials and also the Java® Language Specification (=JLS).  Yes, read the JLS. If Sun are going to publicise useful information in the JLS, how can anybody complain if you use that information?
Maybe you can use a Map to map the different cards to their pictures from your download. Maybe that should be done at a later stage in your application development.
 
Victor Nizeyimana
Greenhorn
Posts: 6
Mac IntelliJ IDE Netbeans IDE TypeScript Redhat Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:I have already complained about applets, and you read that bit yourself.

Don't try any GUIs or anything like that until you have got the application working without a GUI. Do whatever you need to do with the cards in a console application first, then you can add a GUI.

I am not sure how useful that code you downloaded is going to be. You can find card symbols in Unicde here and here. Because some of those Unicode values are > 0xffff, you may have to do this sort of thing:-This is 1f0aa: 🂪. Unfortunately it doesn't seem to give you hearts/diamonds in red.
Find out about enumerated types from the Java™ Tutorials and also the Java® Language Specification (=JLS).  Yes, read the JLS. If Sun are going to publicise useful information in the JLS, how can anybody complain if you use that information?
Maybe you can use a Map to map the different cards to their pictures from your download. Maybe that should be done at a later stage in your application development.



That is awesome cards in Unicode! Only the assignment is still an applet... -.- Really don't like it...
 
Campbell Ritchie
Marshal
Posts: 69847
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Victor Nizeyimana wrote:. . . . Only the assignment is still an applet... -.- Really don't like it...

Unfortunately you will have to use the applet if you want good marks. You have already read my opinions on another thread. Upgrade to Java11 and see how many warnings you get from the compiler.
Java11 is an LTS version an Java8 is nearing the end of its “lifetime”.
 
Liar, liar, pants on fire! refreshing plug:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic