Deveant Posted August 15, 2009 Share Posted August 15, 2009 Resix put you challenge up mate. Quote Link to comment Share on other sites More sharing options...
Resix Posted August 15, 2009 Share Posted August 15, 2009 Coding challenge number 2: The stockmarket crysis (pseudo-) prophecy. Write a program or piece of code that: 1. Takes an initial Value of a Stock. 2. Takes the aimed value of the Stock and predicts the time it will take for the stock to rise to your desired value. The program should do many of these calculations (100) , and give you an average value of how many days to expect. Now for the rules: The Percent in- or de-crease cannot just be random e.g. +10, 2, -13 +5, +6, -24. These must be "weighted". Think gaussian curves and probability. The program must make use of modern pc hardware: multiple cores or multiple threads. The program can be written in ANY language, even in assembler if you want or can. The most efficient program wins. Meaning the program that can return an average value of 100 calculations the fastest and most efficient, and fulfills all of the above, wins. It seems this program is already out in the wild and being used by many brokers, but it's probably shareware and +1000$, otherwise I can't explain the current situation on the markets. Pseudo because, of course we know stock markets seem random but they actually react to events in the industry and in politics and so on, this program will never give you a reliable source of information for your portfolio. Hope this was understandable. Should be interesting. :D Quote Link to comment Share on other sites More sharing options...
corcrash Posted August 15, 2009 Share Posted August 15, 2009 Lols! Sorry but do u think this is for a small programing challenge? I mean the coding of this program could take months! I suggest someone else makes a challenge, this one is not realistic i u ask me! The challenges should be something u can make in (at most) 2-3 weeks, not something u could sell for 1000$! Quote Link to comment Share on other sites More sharing options...
Deveant Posted August 15, 2009 Share Posted August 15, 2009 haha i agree with corcrash, thats full blown software not a programmers challange. Quote Link to comment Share on other sites More sharing options...
corcrash Posted August 15, 2009 Share Posted August 15, 2009 So if u don't have some lightweight idea, i would like some one else to post a challenge, cause i don't have an idea. Quote Link to comment Share on other sites More sharing options...
Resix Posted August 16, 2009 Share Posted August 16, 2009 actually I tried making this myself in ruby for example, and it's easier than u think. took me about 60 lines of code. but without the multicore support, but multiple threads Quote Link to comment Share on other sites More sharing options...
merctom Posted August 18, 2009 Share Posted August 18, 2009 The program you described will never work. Way way too many variables for it to calculate reliable figures. And if you are not calculating reliable figures you might as well pull a random number and display that as your result. Quote Link to comment Share on other sites More sharing options...
enlagmago Posted August 26, 2009 Share Posted August 26, 2009 Could you tell me where I can learn how to code? I mean, like, the basic rudiments of coding. I dont even begin to know how to. My first thought is Steve Tacks website, unless you know of somewhere better. _________________ SPAM REMOVED Quote Link to comment Share on other sites More sharing options...
Deveant Posted August 26, 2009 Share Posted August 26, 2009 There is a sticky in this section for starting out. http://hak5.org/forums/index.php?showtopic=9017 This isnt really the best place to ask, as its for the challenges. but the above link will get you started for windows based programming. Quote Link to comment Share on other sites More sharing options...
dr0p Posted September 11, 2009 Share Posted September 11, 2009 char image[255]; int main(int argc, char *argv[]) { ... Â Â Â Â Â Â Â Â strcpy(image, argv[1]); Â Â Â Â Â Â Â Â Â Â Â Â ... } Oh hai there buffer overflow :3 ( I know I'm a month late lmao) Quote Link to comment Share on other sites More sharing options...
Emeryth Posted December 20, 2009 Share Posted December 20, 2009 Time to get this back up! Here's the challenge I mentioned a while ago: A game in 100 lines of code. The Rules: -Any language -Any kind of game -The submission should simply be 100 (or less) lines of text -Even empty lines are counted - to simplify -No additional files (unless your language/environment absolutely requires it) -Using only standard libraries is allowed -The above rules can bent or broken if you have a good reason It's not about how much code can you fit in 100 lines, try making it readable. There is no deadline, and everyone who submits something will be a winner. Because I think you're all n00bs, who can't even write "Hello World" in under 100 lines ;P Here's my 100 line Arkanoid in Java to motivate you: package java101; import java.awt.Color; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.util.Random; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingWorker; public class Main { static GamePanel panel; static int ball_x=13000,ball_y=15000,ball_vx=0,ball_vy=200,ball_last_x,ball_last_y,paddle_x =130,paddle_width=64,game_state=0,points=0,lives=3; public static void main(String[] args) { JFrame window = new JFrame(); window.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); panel =new GamePanel(); for (int x=0;x<10;x++ ) for (int y=0;y<10;y++ ){ if(x>0&&x<9&&y>0)panel.field[x][y]=new Random().nextInt();} window.add(panel); window.setSize(320, 260); window.setResizable(false); window.setVisible(true); window.setTitle("Arkanoid 101"); window.addMouseMotionListener(new MouseMotionListener(){ public void mouseDragged(MouseEvent e) { Main.game_state=1;} public void mouseMoved(MouseEvent e) { Main.paddle_x=e.getX()-32; if (Main.paddle_x<0)Main.paddle_x=0; if (Main.paddle_x>320-Main.paddle_width)Main.paddle_x=320-Main.paddle_width; Main.panel.repaint();} }); SwingWorker time = new SwingWorker() { @Override protected Object doInBackground() throws Exception { while (true){ if (game_state==1&&lives>0){ ball_last_x=ball_x; ball_last_y=ball_y; ball_x+=ball_vx; ball_y+=ball_vy; if (ball_last_x/100!=ball_x/100||ball_last_y/100!=ball_y/100)Main.panel.repaint(); if (ball_x/100-2<=0||ball_x/100+2>=310)ball_vx=-ball_vx; else if (ball_y/100-3<=0)ball_vy=-ball_vy; else if (ball_y/100+3>=200) if(ball_x>=paddle_x*100&&ball_x<=(paddle_x+paddle_width)*100){ball_vy=-ball_vy; ball_vx=(ball_x/100-paddle_x-paddle_width/2)*5; ball_vx= (ball_vx<0) ? ball_vx-50 : ball_vx+50; ball_vy= (ball_vx<0) ? ball_vx-50 : -ball_vx-50; } else{ lives--; Main.game_state=0; Main.ball_x=13000; Main.ball_y=15000; Main.ball_vx=0; Main.ball_vy=200;} else if(ball_y<10000&&ball_y>300&&ball_x<31700&&ball_x>300){ if (panel.field[ball_x/3200][(ball_y/100-3)/10]!=0)destroy_block(0,-3); else if (ball_y<9000&&panel.field[ball_x/3200][(ball_y/100+3)/10]!=0)destroy_block(0,3); else if (panel.field[(ball_x/100-2)/32][ball_y/1000]!=0)destroy_block(-2,0); else if (panel.field[(ball_x/100+2)/32][ball_y/1000]!=0)destroy_block(2,0);}} Thread.sleep(10);} }}; time.run(); } static void destroy_block(int x, int y){ panel.field[(ball_x/100+x)/32][(ball_y/100+y)/10]=0; ball_vx= (x!=0) ? -ball_vx : ball_vx; ball_vy= (y!=0) ? -ball_vy : ball_vy; points+=Math.abs(ball_vx/10)+Math.abs(ball_vy/10); } } class GamePanel extends JPanel{ int field[][]=new int[10][10]; @Override public void paintComponent(Graphics g){ g.setColor(Color.WHITE); g.fillRect(0, 0, 320, 240); for (int x=0;x<10;x++ ) for (int y=0;y<10;y++ ){ g.setColor(new Color(Integer.MAX_VALUE-field[x][y])); g.fillRect(x*32, y*10, 32, 10); } g.setColor(Color.BLACK); g.fillRect(Main.paddle_x, 200, Main.paddle_width, 10); g.drawOval(Main.ball_x/100-2, Main.ball_y/100-2, 5, 5); g.drawString("Lives: "+Main.lives+" Points: "+Main.points, 0, 220); if (Main.game_state==0&&Main.lives>0) g.drawString("Click and drag to start", 100, 120); if (Main.lives==0) g.drawString("GAME OVER", 100, 120); } } Quote Link to comment Share on other sites More sharing options...
kaizen_0 Posted December 22, 2009 Share Posted December 22, 2009 well at least your are trying to get it going again, i might do it, cause im bored as hell, and it sounds like fun. maybe... if i remember and have time... XD Quote Link to comment Share on other sites More sharing options...
kelsimon43 Posted July 16, 2021 Share Posted July 16, 2021 JudoCoder contains hand-picked selection of programming and algorithm questions asked by top Tech companies (Google, Facebook, Apple, Amazon, Netflix, Uber, you name it). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.