Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge (Out-of-Date)
New Posts  All Forums:Forum Nav:

Programming Challenge (Out-of-Date) - Page 29  

Poll Results: Are you interested in participating in and/or helping organise and post these programming challenges?

 
  • 100% (2)
    I want to participate.
  • 0% (0)
    I want to contribute by helping posting and organise these challenges.
  • 0% (0)
    I'll only take part if other people are willing to participate.
  • 0% (0)
    I can help and participate - I love programming!
  • 0% (0)
    I do not wish to participate or help.
2 Total Votes  
post #281 of 306
Quote:
Originally Posted by MakubeX View Post
Is that current job with IBM?
I wish lol. No its a small software company called Wetstone Technologies. They make forensics software as well as doing gov contract work. I can see why you would think that though.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
post #282 of 306
The test looks like a fun challenge, I'll see if I can find some time to do it.
post #283 of 306
Quote:
Originally Posted by MakubeX View Post
The test looks like a fun challenge, I'll see if I can find some time to do it.
Awesome. I hope several people attempt it b/c I always enjoy comparing methods of doing things. I will be really interested to see if anyone gets the first step exactly correct and whether it is different than my method.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
post #284 of 306
C++
Code:
#include <iostream>
#include <conio.h>
#include <vector>

using namespace std;

int AtoE(const unsigned int c)
{
static unsigned int a2e[256] = {
          0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 37, 11, 12, 13, 14, 15,
         16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
         64, 79,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,
        240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111,
        124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214,
        215,216,217,226,227,228,229,230,231,232,233, 74,224, 90, 95,109,
        121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150,
        151,152,153,162,163,164,165,166,167,168,169,192,106,208,161,  7,
         32, 33, 34, 35, 36, 21,  6, 23, 40, 41, 42, 43, 44,  9, 10, 27,
         48, 49, 26, 51, 52, 53, 54,  8, 56, 57, 58, 59,  4, 20, 62,225,
         65, 66, 67, 68, 69, 70, 71, 72, 73, 81, 82, 83, 84, 85, 86, 87,
         88, 89, 98, 99,100,101,102,103,104,105,112,113,114,115,116,117,
        118,119,120,128,138,139,140,141,142,143,144,154,155,156,157,158,
        159,160,170,171,172,173,174,175,176,177,178,179,180,181,182,183,
        184,185,186,187,188,189,190,191,202,203,204,205,206,207,218,219,
        220,221,222,223,234,235,236,237,238,239,250,251,252,253,254,255
};
        return a2e[c];
}

int main()
{
int a;
vector<int> keyboard;
while(1)
{
if (_kbhit())
{ 
keyboard.push_back(_getch());
a = keyboard.size();
a--;
if(keyboard[a] >= 48 && keyboard[a] <= 57 || keyboard[a] >= 65 && keyboard[a] <= 90 || keyboard[a] >= 97 && keyboard[a] <= 122 || keyboard[a] == 32 || keyboard[a] == 33 || keyboard[a] == 46 || keyboard[a] == 44 || keyboard[a] == 59 || keyboard[a] == 63)
{
cout << (char)keyboard[a]; 
}
else if(keyboard[a] == 13)
{
system("cls");
for(int i=0;i<keyboard.size()-1;i++)
{
printf("%X ", keyboard[i]);     //hex
}
for(int i=0;i<keyboard.size();i++)
{
printf("%c", keyboard[i]);      //ascii
}
printf("\
");
for(int i=0;i<keyboard.size()-1;i++)
{
printf("%X ", AtoE(keyboard[i]));   //EBCDIC hex
}
for(int i=0;i<keyboard.size();i++)
{
printf("%c", keyboard[i]);        //ascii
}
}
else if(keyboard[a] == 8)
{
cout << (char)8 << (char)32 << (char)8; 
keyboard.pop_back();
keyboard.pop_back();
}
else keyboard.pop_back();
}
}
return 0;
}
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
post #285 of 306
Good job man ^. I like the idea of a lookup table.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
post #286 of 306
there's just two problems. in the example there's word wrap. no idea if that's important but i didn't bother doing that and also i have no idea what ADDR is ( address? if so an address of what? )
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
post #287 of 306
Quote:
Originally Posted by austinb324 View Post
Good job man ^. I like the idea of a lookup table.
Except he violated rule #4.
post #288 of 306
I don't want to go off topic here, but does anyone know an actual site that can teach me the basics to learning programming on the side? I'm going to be studying CompSci, so having secondary early knowledge in programming would be awesome.

If you're going to ask what language, I'm most interested in C++ currently.
post #289 of 306
Quote:
Originally Posted by newbie1911 View Post
there's just two problems. in the example there's word wrap. no idea if that's important but i didn't bother doing that and also i have no idea what ADDR is ( address? if so an address of what? )
That was just used for showing an example output. I dont know why it said ADDR but the output should look exactly as it did on the sheet.

Quote:
Originally Posted by MakubeX View Post
Except he violated rule #4.
Well if your referring to conio.h, I don't think there is any other way to do it. I would love to see a solution where conio is not used. It is in the grey area b/c it is not technically a standard lib function but it is still included with all modern compilers.

Quote:
Originally Posted by E-Peen View Post
I don't want to go off topic here, but does anyone know an actual site that can teach me the basics to learning programming on the side? I'm going to be studying CompSci, so having secondary early knowledge in programming would be awesome.

If you're going to ask what language, I'm most interested in C++ currently.
You know, I am not sure how good of a tutorial this site will have but I use cplusplus.com on a daily basis as a reference. click me
Edited by austinb324 - 6/29/11 at 11:57am
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 970 B1 EVGA X58 SLI (E758) Gigabyte GTX 970 Gaming Crucial Ballistix Tactical 12GB 
Hard DriveOSMonitorKeyboard
Intel X25-M 80GB, WD Caviar Black 1TB, WD CG 2TB Windows 7 x64 Ultimate Asus 24", ViewSonic 22" Saitek Cyborg 
PowerCaseMouseMouse Pad
CORSAIR TX850 HAF 932 Logitech G500 OCZ Behemoth 
  hide details  
post #290 of 306
Quote:
Originally Posted by austinb324 View Post
Well if your referring to conio.h, I don't think there is any other way to do it. I would love to see a solution where conio is not used. It is in the grey area b/c it is not technically a standard lib function but it is still included with all modern compilers.
[/URL]
As long as it's ok with your employer.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
This thread is locked  
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge (Out-of-Date)