-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Inspired by http://xkcd.com/710/ here is a code golf for it.
The Challenge
Given a positive integer greater than 0, print out the hailstone sequence for that number.
The Hailstone Sequence
See Wikipedia for more detail..
If the number is even, divide it by two.
If the number is odd, triple…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
The Challenge
The shortest code by character count to display a representation of a circle of radius R using the *character, followed by an approximation of p.
Input is a single number, R.
Since most computers seem to have almost 2:1 ratio you should only output lines where y is odd.
The approximation…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
The Challenge
The shortest code by character count to display a representation of a circle of radius R using the *character. Followed by an approximation of pi
Input is a single number, R
Since most computers seem to have almost 2:1 ratio you should only output lines where y is odd.
The approximation…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383
The Problem
Assume the user gives you a numeric input ranging from 1 to 7. Input should be taken from the console, arguments are less desirable.
When the input is 1, print the following:
***********
*********…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Post your shortest code, by character count, to check if a player has won, and if so, which.
Assume you have an integer array in a variable b (board), which holds the Tic Tac Toe board, and the moves of the players where:
0 = nothing set
1 = player 1 (X)
2 = player 2 (O)
So, given the array b…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
So I've been getting into a bit of assembly lately and I'm a beginner so i was wondering if someone could clarify something. I take it every process has it's own set of registers, and each thread can modify these registers right?. How then do multiple threads use the same registers without causing…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm a beginner learning some assembly, when preserving the ESP register before a function call does it matter if you do it by adding or subtracting? hard to explain, consider the following
mov esi, esp
sub esp, 12 // on 32bit OS this would mean that there are 3 arguments to the function
// push,…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Sorry if I am not supposed to post beginner level questions here..I am new to this site
Please read the code below first
I am confused about getchar() 's role in the following code.. I mean I know its helping me see the output window which will only be closed when I press enter key
So getchar()…
>>> More
-
as seen on Oracle Blogs
- Search for 'Oracle Blogs'
Learning new technologies can be daunting. If you’ve never used a Mac before, you’ll probably be a bit baffled at first. But, you’re probably at least coming from a desktop computing background (Windows), so you common frame of reference.
But what if you’re just now learning…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
My brother is just starting out college. He's studying the same thing I am here in Bolivia; Systems Engineer which is the equivalent of what a CS degree is in the US.
Being his big brother and a programmer myself I really want to guide him and give him the right material to learn and become good…
>>> More