Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A nice programming riddle!

Author: Robert Hyatt

Date: 11:24:05 07/03/02

Go up one level in this thread


On July 02, 2002 at 20:14:15, Omid David wrote:

>How do you swap the value of two integers without using a temporary integer (and
>do it in one command)?
>For example if a=3, b=7, after that one_line_command the values will be a=7,
>b=3.
>
>Hint: Use bitwise operations.


Another hint:  look at the asm exchange instruction.  :)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.