Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Object game

  1. #1
    Member
    Join Date
    Apr 2010
    Location
    The Hague, Netherlands
    Posts
    91
    Thanks
    3
    Thanked 10 Times in 10 Posts

    Lightbulb Object game

    Hey guys,

    After checking out the topic "http://www.javaprogrammingforums.com...-programs.html" I though of a new potential game.

    We're going to make a program together now it doesn't need to be a awesome object( could be ) but it should be written by all the active members together.

    Someone think of a fun object to make together, then start off, everyone that wants in should take over the code in the last code-reply and then add 1 to 3 statements(not lines but statements, so a loop with 2 statements are ok).

    Make sure its bug-free if you post it on the forum. No forks, its just for the fun anyway

    And remember to put comments in! and ofcourse tabs, enters, spaces, just the right format for readability

    Good idea?
    Last edited by Bryan; July 7th, 2010 at 04:06 AM.


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Object game

    might as well get started somewhere... I left off the imports because I was lazy and plus they would use up my 2 lines of actual code! Sorry about the messy kernel code (and I have no idea if it works)

    /**
     A simple test class for the JOCL library. Compiles a few kernels and runs them
     */
    public class JOCLTest
    {
        // A kernel that adds two lists of number together and stores the result into result
        public static String addList = "#pragma OPENCL EXTENSION cl_amd_fp64 : enable\n" + "__kernel void addList(__global double* listA, __global double* listB, __global uint length, __global double* result)\n" + "{int i = get_global_id(0);\nresult[i] = listA[i] + listB[i];}\n";
    }
    Last edited by helloworld922; July 8th, 2010 at 12:22 AM.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Object game

    /**
     A simple test class for the JOCL library. Compiles a few kernels and runs them
     */
    public class JOCLTest implements Runnable
    {
        // A kernel that adds two lists of number together and stores the result into result
        public static String addList = "#pragma OPENCL EXTENSION cl_amd_fp64 : enable\n" + "__kernel void addList(__global double* listA, __global double* listB, __global uint length, __global double* result)\n" + "{int i = get_global_id(0);\nresult[i] = listA[i] + listB[i];}\n";
     
        /**
        *Constructor
        */
        public JOCLTest(){
            super();
        }
        /**
        *Implementation of the Runnable interface
        */
        public void run(){
     
        }
    }

Similar Threads

  1. 2D Object makes my object smaller, Why?
    By MassiveResponse in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 15th, 2010, 02:33 PM
  2. Help with object
    By Spangle1187 in forum Collections and Generics
    Replies: 3
    Last Post: April 22nd, 2010, 04:34 PM
  3. Class and Object
    By jyothishey in forum Object Oriented Programming
    Replies: 2
    Last Post: January 25th, 2010, 08:48 AM
  4. Object o = new Object(); need help
    By zeeshanmirza in forum Object Oriented Programming
    Replies: 11
    Last Post: January 6th, 2010, 10:01 PM
  5. Object Injection
    By Json in forum Java Programming Tutorials
    Replies: 1
    Last Post: December 4th, 2009, 04:08 AM