Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   The Lounge (http://zelaron.com/forum/forumdisplay.php?f=183)
-   -   (2 += 2) = ? (http://zelaron.com/forum/showthread.php?t=46977)

Goodlookinguy 2008-09-29 03:34 PM

(2 += 2) = ?
 
6

That's it. Just 6. Or does it equal something else?

Does anyone not understand this?


I'm trying to get people thinking.

2 += 2 | 2 = 2 + 2 | Now, does that make sense?

I will state the answer in a moment.

D3V 2008-09-29 03:47 PM

0 ?

Goodlookinguy 2008-09-29 03:49 PM

Quote:

Originally Posted by D3V (Post 654579)
0 ?


The answer was false.

D3V 2008-09-29 03:50 PM

Oh. I had seen (2+=2) .. which isn't even a problem.

Goodlookinguy 2008-09-29 03:52 PM

Quote:

Originally Posted by D3V (Post 654583)
Oh. I had seen (2+=2) .. which isn't even a problem.


Actually, in programing it is. You can use something like "variable += 1" which is the same as saying "variable = variable + 1"

Kazilla 2008-09-29 04:04 PM

2 += 2 | 2 = 2 + 2 | OR

2 + x = 2 | 2 = 4 |

x = 0 | 2

x = 0/2

x = 0

false.

-Spector- 2008-09-29 04:14 PM

| | Imply absolute value?

Goodlookinguy 2008-09-29 04:22 PM

Quote:

Originally Posted by -Spector- (Post 654592)
| | Imply absolute value?


No, I was not implying absolute value. I was just using "|" to separate my things.

Asamin 2008-09-29 04:26 PM

Quote:

Originally Posted by Goodlookinguy (Post 654577)
2 += 2 | 2 = 2 + 2 | Now, does that make sense?

I will state the answer in a moment.

That was unfair. you added this info after D3V posted and made it so obvious that is is annoying.

Medieval Bob 2008-09-29 04:27 PM

What exactly are you trying to ask?

The plus equals notation is invalid with a constant on the left. It just doesn't mean anything.

Goodlookinguy 2008-09-29 04:41 PM

Quote:

Originally Posted by Medieval Bob (Post 654596)
What exactly are you trying to ask?

The plus equals notation is invalid with a constant on the left. It just doesn't mean anything.


I already wrote the answer, "false."

(2 += 2) = false

Grav 2008-09-29 07:58 PM

Here's an easy one...

What is the output produced by this script?
x= 1;
for k= 8:-2:3
x= x+k;
disp(x)
end

Goodlookinguy 2008-09-29 08:20 PM

Quote:

Originally Posted by Grаν¡tоnЅurgе (Post 654623)
Here's an easy one...

What is the output produced by this script?
x= 1;
for k= 8:-2:3
x= x+k;
disp(x)
end

This looks like, hmm, almost like BASIC language.

disp is a BASIC language trait.

Alright, this is not like a usual for statement, so I can't answer it. I also don't know BASIC language very well.

Grav 2008-09-29 08:23 PM

Lol, it's MATLAB, which is the only language I can write in besides Fortran.

Goodlookinguy 2008-09-29 08:32 PM

Quote:

Originally Posted by Grаν¡tоnЅurgе (Post 654627)
Lol, it's MATLAB, which is the only language I can write in besides Fortran.


I'm telling you right now, MATLAB is based on BASIC. As are many other languages.

If you've ever messed with a TI calculator, the language used is called TI-BASIC, which is based on basic, and similar in syntax.

Anyways, that's neato, I'd never heard or seen that language used before. I think I might learn it just for the fun of it.

Random PHPness.
PHP Code:

<?php
setSession
();
if (!
$_GET['kill']) {
 if (!
$_SESSION['test']) {
  
$_SESSION['test'] = 0;
 }
 else {
  
$test $_SESSION['test'];
  echo 
$test;
 }
}
elseif (
$_GET['kill']=="now") {
 
unlink($_SESSION['test']);
}
else {
 
// This will never appear
}
?>


Grav 2008-09-29 08:35 PM

Quote:

Originally Posted by Goodlookinguy (Post 654628)
I'm telling you right now, MATLAB is based on BASIC.


Thank you

Kazilla 2008-09-29 08:51 PM

do
line (20,20)-(40,40); CLR:R
do loop while end keys = ""

something like that? Qbasic was so much fun sophomore year.

Goodlookinguy 2008-09-29 09:00 PM

Quote:

Originally Posted by Kazilla (Post 654634)
do
line (20,20)-(40,40); CLR:R
do loop while end keys = ""

something like that? Qbasic was so much fun sophomore year.


Yeah, something like that. BASIC is written line by line. MATLAB is broken by semi-colons which separates it from BASIC. However, it uses the same terms by which BASIC programs are built upon.

Also, just so everybody knows, BASIC is called BASIC for more than the words it stands for. It was made easy so that people could pick it up easily, but I always found it to be too loose.


All times are GMT -6. The time now is 03:20 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.