The Way to Programming
The Way to Programming
I have a couple of books on critical thinking skills and reasoning skills on my computer.
These are the titles of the books I have. You can look them up on Amazon most of them are downloadable online, but a couple of them aren’t available in print.
Are you sure there’s no beginner’s guides to analytical thinking.
i’ve found this tutorial.
https://www.udemy.com/php-search-form/
but whenever i tried to connect database(localhost) using old
mysql_connect()
languange(mysql), the result said ‘use the mysqli or PDO instead. the mysql no longer support by latest phpmyadmin.
Since you are working on windows, you should try using the GetKeyState function inside a loop that runs over a specified interval:
#include#include #include using namespace std; int main(void) { bool shouldExit = false; do{ if(GetKeyState(VK_LEFT)<0){ cout<<"left key pressed!\n"; //movePlayerToLeft(); }else if(GetKeyState(VK_RIGHT)<0){ cout<<"right key pressed!\n"; //movePlayerToRight(); }else if(GetKeyState(VK_UP)<0){ shouldExit = true; } Sleep(100); }while ( !shouldExit ); }
The above example should work.
you can change Sleep(100) so as to make the program respond faster or slower.
Sharing whole project
#include#include #include using namespace std; unsigned int i ,j , hM , lM , cron=0 , Gcron=0 , k , viata=2 , culoare , d , prevent=0 , scor , urca=20 , re; int nrtrap=0; char a , minge=257; char joc[17][14]; void gotoxy(short x, short y) { COORD pos = {x, y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);} void draw(){ gotoxy(0,0); for(j=0;j<=13;j++){ for(i=0;i<=16;i++){ if(joc[i][j]=='_' || joc[i][j]=='-' || joc[i][j]=='"') culoare=14; else if(joc[i][j]==minge) culoare=12; else if(joc[i][j]=='*') culoare=14; else if(joc[i][j]==3) culoare=12; else if(joc[i][j]=='#') culoare=10; else if(joc[i][j]=='|' && i!=0 && i!=16) culoare=11; else if(joc[i][j]=='|') culoare=14; SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), culoare); cout< 0) || (a=='s' && sfori>0)){ prevent=0; sfori--; sf=1; while(joc[hM][lM-sf]!='*' && joc[hM][lM-sf]!='_' && joc[hM][lM-sf]!='#'){ joc[hM][lM-sf]='|'; sf++; draw();} while(joc[hM][lM-1]=='|'){ joc[hM][lM]=' '; lM--; joc[hM][lM]=minge; draw();} }}/* aci se termina */ cron++; Gcron++; if((joc[hM][lM+2]=='*' && cron==urca) || (joc[hM][lM+2]=='#' && cron==urca)) primu=1; else if(Gcron>=8 && joc[hM][lM+1]!='*'){ joc[hM][lM]=' '; lM++; joc[hM][lM]=minge; Gcron=0; scor++; if(prevent==1){ joc[hM][lM]=' '; viata--; d=n; if(capcana[n]==0){ d=n-1; if(d==0) d=4;} lM=lT[d]-1; hM=hT[d]; scor--; }} else if(joc[hM][lM+1]=='*' && cron==urca){ joc[hM][lM]=' '; lM--; joc[hM][lM]=minge;} /* urca trapele */ if(cron==urca){ cron=0; trap++; if(lV==0){ existV=0; hV=0; lV=0;} if(lSF==0){ existSF=0; hSF=0; lSF=0;} if(existV==1){ lV--; joc[hV][lV]=3;} if(existSF==1){ lSF--; joc[hSF][lSF]='|';} for(k=1;k<=4;k++){ if(existenta[k]==1){ joc[hT[k]][lT[k]]=' '; joc[hT[k]-1][lT[k]]=' '; joc[hT[k]+1][lT[k]]=' '; lT[k]--; if(capcana[k]==1){ joc[hT[k]][lT[k]]='*'; joc[hT[k]-1][lT[k]]='*'; joc[hT[k]+1][lT[k]]='*';} else if(capcana[k]==0){ joc[hT[k]][lT[k]]='#'; joc[hT[k]-1][lT[k]]='#'; joc[hT[k]+1][lT[k]]='#';} }} if(prevent==1){ viata--; d=n; if(capcana[n]==0){ d=n-1; if(d==0) d=4;} lM=lT[d]-1; hM=hT[d]; }} /* */ /* spawn trap */ if(trap==3){ nrtrap++; nrtrapC++; shansa=rand()%100+1; shansaC=rand()%100+1; if(u!=0) n++; if(n==5) n=1; existenta[n]=1; lT[n]=12; hT[n]=rand()%13+2; if(shansaC>20 || nrtrap<5){ capcana[n]=1; joc[hT[n]][lT[n]]='*'; joc[hT[n]-1][lT[n]]='*'; joc[hT[n]+1][lT[n]]='*'; } else if(nrtrapC>1) { capcana[n]=0; joc[hT[n]][lT[n]]='#'; joc[hT[n]-1][lT[n]]='#'; joc[hT[n]+1][lT[n]]='#'; nrtrapC=0;} else{ capcana[n]=1; joc[hT[n]][lT[n]]='*'; joc[hT[n]-1][lT[n]]='*'; joc[hT[n]+1][lT[n]]='*'; } if(nrtrap%15==0){ hV=hT[n]; lV=lT[n]-1; joc[hV][lV]=3; existV=1;} if(shansa<21 && shansaC>20 && nrtrap>1 && nrtrap%15!=0 && existSF!=1){ hSF=hT[n]; lSF=lT[n]-1; joc[hSF][lSF]='|'; existSF=1;} u=1; trap=0;} /* */ /* mige */ if(primu==0 && re==0){ hM=hT[1];lM=11; joc[hM][lM]=257;} /* */ if(lM==0){ viata--; d=n; if(capcana[n]==0){ d=n-1; if(d==0) d=4;} lM=lT[d]-1; hM=hT[d]; } SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), 12); gotoxy(18,0); cout<<"Vieti:"; cout<
Possible that you’re trying to update the character movement too frequently? I’m not really familiar with C++ (I’m a Java developer) so this is simply a guess Smile but I Googled a bit and it seems that you might need to check the character at a fixed interval instead of reading off the input stream for as long as you have data in the stream.
http://stackoverflow.com/questions/13613431/how-to-use-kbhit-with-delay-without-waiting
http://www.cprogramming.com/fod/kbhit.html
Use x86 emulator like bluestacks, android x86 or genymotion that run with virtualbox
To all the expert programmers posting in this thread, why don’t you link your github profiles so we can see your code? Words are just air blowing, facts stand in a totally different ground.
The programming language is merely a tool: what is the human language for a philosopher? The answer is all languages, some have precise words in others you must use more words. Programming is not about choosing between “for x in range(x, y)” and “for (x=0; x
I started with QBASIC almost 16 years ago and then moved on to VisualBasic, DarkBASIC, Blitz3D and BlitzMax. I then learnt C, C++, Java and C#. More recently I learnt Python and Objective-C. Once you know one language it is much easier to pick up a new one over a weekend or free evenings. The early days I sought help from online communities asking questions and best approaches and then once my ability grew I was able to apply my knowledge to new languages with the aid of books allowing me to learn the syntax and any important quirks of the language.
I started with QBasic a those were the days. The days where the code was fast and the machines where slow. Nowadays most coding is slow and just to looks cool on a 2GB IDE full of plugins but the machines are so fast people think nobody needs to care about performance anymore. Computers were so expensive back then you were either regarded as “rich and wasteful with money” or “mad scientist wannabe” if you had one. There was assembly of course but you needed to optimize so much to get program without major bug i haven’t made money out of that venue or anything of professional quality. Of course assembly high level compared to the “punched” cards my mother had to work with on a mainframe at her university.
Sorry if you didn’t like me remembering the old times, i just grew reminisced of them for a second.
I went back to college for the second time in 1980 after a decade of playing drums. I got interested in Computer Graphics class (then it was in its infancy) and started taking Computer Science classes.
I used to have the janitors lock me into the CS Lab building so I could slave away all night. It didn’t take long for the Director of the CS program to put a stop to finding me asleep on the floor. He hired me to be the director of the student labs. And this when I was in my very first semester.
So, I got paid for doing what I loved to do.
The best advice is to learn some good techniques and then practice, practice and practice some more.
Programming is about solving problems, then applying those solutions with code in a development environment and language.
The hardest part is learning how to create the algorithms or solutions (breaking apart the problems) once you figure out how to dissect a problem it becomes easier to do that.
Once to solve a problem and code it in one language, doing the same problem in another language is a little easier and by the time you’ve done it on your fifth language you start to get the BIG picture.
Here is a FANTASTIC series offered for free by MIT on doing just that.
If you complete this series and do the exercises you will learn Python in the process and also become a very good problem solver and programmer.
http://www.youtube.com/watch?v=bX3jvD7XFPs
I started a year ago at my college. I barely knew how to use a computer and even less with what I wanted to do with my life. Started by building a small graphics package in Java based on swing with which I built doodle jump, tetris, pacman. Was then interested in mac development so learnt objective-c and built a mac application (really recommend the bignerdranch books btw). This last semester I’ve been coding a lot of different algorithms and implementing ADTs in python and java like the seamcarve algorithm (dynamic picture resizing).
My advice would be to find any way you can take classes and learn from other people in a live environment, because at least personally, that’s the way to go. Make your own projects and go out and do them. Something cool to check out is Hacker School NY, it’s free so has an application process.
Reading books is great to learn new stuff but as somebody said, don’t waste too much time on them. Go out and play.
Studies C and Java at school! Mini programs and then Created a game server ( Game A3 ) with lots of hex editing.. and now on..
I wouldn’t call myself a full blown programmer, more just a dabbler. These days however, web programming more than low level programming. I first learnt DOS because if I didn’t, I wouldn’t be able to reformat the hard drive and reinstall Windows again after I screwed it up (and it was many, many times). Fortunately the process wasn’t as streamlined like it is today, so it enabled me to get really acquainted with commands and configuring the O/S in the command line as opposed to the GUI. Absolutely fundamental. Probably wouldn’t be running linux servers today if I hadn’t delved into the “black hole” back then.
Technology is fantastic and especially when it makes things easier. I just hope children of today can continue to help it advance with logic behind it…
i first got interested in programming. I asked my parents for a a book that will teach me visual basic.
I really cannot recall why I chose visual basic as I am now 25. Since then Ive learnt java and c.
I would recommend starting with java. there are great tutorials that will help you to learn it from scratch.
Sign in to your account