• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:46
CEST 20:46
KST 03:46
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5TL.net Map Contest #21 - Finalists4Team TLMC #5: Vote to Decide Ladder Maps!0
Community News
5.0.15 Patch Balance Hotfix (2025-10-8)60Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition275.0.15 Balance Patch Notes (Live version)119$2,500 WardiTV TL Map Contest Tournament 154
StarCraft 2
General
5.0.15 Patch Balance Hotfix (2025-10-8) PartinG joins SteamerZone, returns to SC2 competition Geoff 'iNcontroL' Robinson has passed away Classic Games #3: Rogue vs Serral at BlizzCon Team TLMC #5: Winners Announced!
Tourneys
SC2's Safe House 2 - October 18 & 19 RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Sparkling Tuna Cup - Weekly Open Tournament $2,500 WardiTV TL Map Contest Tournament 15
Strategy
Custom Maps
External Content
Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More Mutation # 491 Night Drive
Brood War
General
Whose hotkey signature is this? BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ I'm making videos again Question regarding recent ASL Bisu vs Larva game
Tourneys
[Megathread] Daily Proleagues [ASL20] Ro8 Day 4 Small VOD Thread 2.0 [ASL20] Ro8 Day 3
Strategy
Siegecraft - a new perspective TvZ Theorycraft - Improving on State of the Art Current Meta Proposed Glossary of Strategic Uncertainty
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread The Games Industry And ATVI Stop the Construction YouTube Thread Things Aren’t Peaceful in Palestine
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1343 users

TL++ [So much ++ its Meta]

Blogs > CecilSunkure
Post a Reply
Normal
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
Last Edited: 2013-06-28 07:05:05
June 28 2013 06:49 GMT
#1
++ is commonly pronounced as "plus plus".

Lets get down to business: the ++ operator in C and C++ is crazy. Here some rules off the top of my head:

+ Show Spoiler [rules] +
i represents a whole number
i++ represents post-increment
post increment has the following properties:
-increments the value i and returns a copy of i made before the increment
-generally creates unnecessary copies of things when used with builtin types
-Cannot be used on rvalues afaik

++i is pre-increment
Properties of pre-increment
-generally the preferred operator for increments
-most of the time has less side-effects than post-increment
-usually results in more readable code
-increments i and returns the incremented i value


The ++ operator is like an addon to the normal + operator. It's an extension like many other ++ things.

[image loading]
An example of a ++ thing that exist as an extension to another thing


Now enough of that. ++ is also used in the name of the language C++ as C++ was built by some dude named Bjarne Stroustrup. C++ can be thought of as mostly a big expansion set to C.

Okay computer sciency things are done.

There's a thingy called Notepad++ and acts as a replacement for Microsoft's shitty Notepad program that comes packaged with Windows. Notepad++ has a bunch of other features that really should have been in Notepad (like reading Linux newlines -.-).

[image loading]
See? ++ things exist.


LASTLY there's TL+. Sure, we all have seen TL+ and it's pretty cool to support TL. However there's also TL++. Clearly we can see that ++ is significant in the C and C++ language in multiples ways. Notepad++ is like an extension or replacement for Notepad.

So this begs the question... Could there be a TL++ expansion to TL+? Is this getting meta on you? Lets call TL++ TLMeta. All the ++.

In TLMeta there's lots of news about the news that goes in the TL+ forum. All the information and all the posts in TLMeta are about the stuff in TL+. How is this fun? Well the magic is that if someone posts in TLMeta about something, even if it isn't truly in TL+ then it will become true.

This is magic. TLMeta is not only about TL+ but it is the keeper of TL+. What happens in TLMeta comes to be.

How can we get TLMeta or get to TLMeta? It's like the 4th dimension. We can only mathematically or logically think about the 4th dimension but we can't really experience it or understand it in a very intuitive or natural way.

[image loading]
Warped time because TLMeta


It exists and it is happening. People are posting in TLMeta all the time, and these people are actually about the people in TL+. I know all this meta is getting a little crazy.

The point is, here's a logimagical proof that TLMeta exists for all you non-believers:

TL is a website
TL+ exists and we are in it
Therefor to keep the ball rolling
TLMeta exists and it is about we


It is the only way imo. u gotta skate

**
LeeARK
Profile Joined October 2010
509 Posts
June 28 2013 06:59 GMT
#2
I'm wondering if somebody spiked Cecil's drink... or if he has too much free time on his hands.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
June 28 2013 07:55 GMT
#3
So.... why is C# called C Sharp... instead of C pound sign or C hash..
Rillanon.au
Klonere
Profile Blog Joined December 2010
Ireland4123 Posts
June 28 2013 07:59 GMT
#4
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..


i assume its because its creator preferred music of telephones or drugs
wozzot
Profile Joined July 2012
United States1227 Posts
June 28 2013 08:03 GMT
#5
Oh no, we've been discovered
(ノ´∀`*)ノ ♪ ♫ ヽ(´ー`)ノ ♪ ♫ (✌゚∀゚)☞ ♪ ♫ ヽ(´ー`)ノ ♫ ♫ (ノ´_ゝ`)ノ彡 ┻━┻
DeepElemBlues
Profile Blog Joined January 2011
United States5079 Posts
June 28 2013 08:03 GMT
#6
the +ception is strong in this blog, 5/5
no place i'd rather be than the satellite of love
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
June 28 2013 09:20 GMT
#7
On June 28 2013 16:59 Klonere wrote:
Show nested quote +
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..


i assume its because its creator preferred music of telephones or drugs

Indeed, C# is actually written C♯ by Microsoft on boxart etc, C# is used simply because the hash is easier to write on a keyboard.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
June 28 2013 10:20 GMT
#8
The # is actually just two overlapping + signs. So it's C[++ in a single character].
If you have a good reason to disagree with the above, please tell me. Thank you.
imallinson
Profile Blog Joined May 2011
United Kingdom3482 Posts
June 28 2013 10:25 GMT
#9
TL++ isn't far enough we need TL#.
Liquipedia
Grovbolle
Profile Blog Joined July 2011
Denmark3811 Posts
June 28 2013 10:27 GMT
#10
Yay, Bjarne Stoustrup was from my Uni. Aarhus, Aarhus, Aarhus!!!!!!
Lies, damned lies and statistics: http://aligulac.com
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 11:13 GMT
#11
Cecil, due to time being warped, I do not know of this thing you call 'TL+' and thus I have no knowledge of how an expansion could ever be made. If you wouldn't mind going into more detail, I would be grateful.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Toboe
Profile Blog Joined February 2010
United States276 Posts
June 28 2013 11:23 GMT
#12
I wanted to gift you TL++ for this blog, but couldn't find the button. Then I realized you had already transcended to the level where you were already a part of TL++. well played
Immortals are your friend, you can tell by the way they waddle at you
uZr
Profile Joined April 2011
20 Posts
June 28 2013 11:26 GMT
#13
+ are everywhere! It's a conspiration ! These guys were well aware of it !
packrat386
Profile Blog Joined October 2011
United States5077 Posts
June 28 2013 11:32 GMT
#14
Yay C++, the only language that I'm pretty competent with (I guess I know a bit of Java). I have so much to learn
dreaming of a sunny day
Burrfoot
Profile Blog Joined July 2012
United States1176 Posts
June 28 2013 11:52 GMT
#15
I say TL switches things up and upgrades TL+ to +TL+ or started with TL. And incrementally went to TL.. TL... all the way past 9000.s
http://us.battle.net/d3/en/profile/Davlok-1847/career
Xivsa
Profile Joined April 2011
United States1009 Posts
Last Edited: 2013-06-28 12:12:50
June 28 2013 12:12 GMT
#16
What is reality but what's perceived? Life imitates art. Wait, I must have that wrong.
I don't know half of you half as well as I should like and I like less than half of you half as well as you deserve. - Bilbo
3FFA
Profile Blog Joined February 2010
United States3931 Posts
Last Edited: 2013-06-28 12:43:23
June 28 2013 12:24 GMT
#17
On June 28 2013 20:52 Burrfoot wrote:
I say TL switches things up and upgrades TL+ to +TL+ or started with TL. And incrementally went to TL.. TL... all the way past 9000.s

Ahh so do something like
    
BOOL newday; //is it a new day? Yes or no answers only.

//other code to define newday would most likely go here.

if(newday = YES) // if it is a new day...
{
double TLplus = 9000; //9000 TL+
for (int TL=1; TL < TLplus; TL++) //endless loop is endless
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //Say hi to R1CH
printf("/n you are now %i R1CH in TL",TL); //TL, new currency.
TLplus ++; //OVER 9000 TL+!
newday = NO; //not a new day anymore :(
return TL; //because why not?
}
}
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
June 28 2013 13:36 GMT
#18
On June 28 2013 21:24 3FFA wrote:
Show nested quote +
On June 28 2013 20:52 Burrfoot wrote:
I say TL switches things up and upgrades TL+ to +TL+ or started with TL. And incrementally went to TL.. TL... all the way past 9000.s

Ahh so do something like
    
BOOL newday; //is it a new day? Yes or no answers only.

//other code to define newday would most likely go here.

if(newday = YES) // if it is a new day...
{
double TLplus = 9000; //9000 TL+
for (int TL=1; TL < TLplus; TL++) //endless loop is endless
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //Say hi to R1CH
printf("/n you are now %i R1CH in TL",TL); //TL, new currency.
TLplus ++; //OVER 9000 TL+!
newday = NO; //not a new day anymore :(
return TL; //because why not?
}
}


//endless loop is endless

Your loop only runs once.
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
June 28 2013 13:55 GMT
#19
That indentation is genius.

Is that a MS troolean type? It should be obvious, but if YES resolves to true, the condition will always be true. Well, if operator= isn't overloaded in some way at least.
If you have a good reason to disagree with the above, please tell me. Thank you.
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 13:58 GMT
#20
Does it go to the if statement first? I thought it went to the for statement first. >.>
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
DusTerr
Profile Blog Joined January 2011
2520 Posts
June 28 2013 14:22 GMT
#21
how does TLPRO fit in?
1nfamous
Profile Joined October 2009
107 Posts
June 28 2013 14:37 GMT
#22
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>


its the return statement that makes your loop only run once.
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
Last Edited: 2013-06-28 14:44:46
June 28 2013 14:44 GMT
#23
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once :(
//you return the value of Tl which is 1
}
}
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
micronesia
Profile Blog Joined July 2006
United States24708 Posts
June 28 2013 15:11 GMT
#24
I'm rusty...


i = 5;
return i++;



i = 5;
return ++i;


In which case will it return 5, and in which will it return 6?
ModeratorThere are animal crackers for people and there are people crackers for animals.
Cyx.
Profile Joined November 2010
Canada806 Posts
June 28 2013 15:19 GMT
#25
On June 29 2013 00:11 micronesia wrote:
I'm rusty...


i = 5;
return i++;



i = 5;
return ++i;


In which case will it return 5, and in which will it return 6?


5 for the first, 6 for the second.
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 15:37 GMT
#26
On June 28 2013 23:44 BisuDagger wrote:
Show nested quote +
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once :(
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
quirinus
Profile Blog Joined May 2007
Croatia2489 Posts
June 28 2013 15:47 GMT
#27
TL+ gift bait? xD
All candles lit within him, and there was purity. | First auto-promoted BW LP editor.
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
June 28 2013 16:21 GMT
#28
On June 29 2013 00:37 3FFA wrote:
Show nested quote +
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once :(
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 16:50 GMT
#29
On June 29 2013 01:21 BisuDagger wrote:
Show nested quote +
On June 29 2013 00:37 3FFA wrote:
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once :(
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.

Hehe. Trust me, I'm doing tons of practice in the years ahead. In fact, I'm experimenting with making a tile-based game app at this very moment.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
June 28 2013 17:12 GMT
#30
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.
DusTerr
Profile Blog Joined January 2011
2520 Posts
June 28 2013 17:27 GMT
#31
On June 29 2013 01:50 3FFA wrote:
Show nested quote +
On June 29 2013 01:21 BisuDagger wrote:
On June 29 2013 00:37 3FFA wrote:
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.

Hehe. Trust me, I'm doing tons of practice in the years ahead. In fact, I'm experimenting with making a tile-based game app at this very moment.

I think I learned more in this thread than I did in class... (why was there always some gsl/pl/gstl on when I'm in school?)
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-06-28 17:46:11
June 28 2013 17:44 GMT
#32
On June 29 2013 02:12 wherebugsgo wrote:
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.

So now instead of

void func(int i) { }
int i = 42;
func(i++);

you always write

void func(int i) { }
int i = 42;
int t;
func((t = i, i += 1, t));

Yes, that's an assignment too, even though there is no = sign in the function call.

Granted, the sequence
vector<int> v(10, 0);
int i = 0;
v[i] = i++;
Can resolve to pretty much anything your compiler wants it to, but is that a reason to avoid ++?

My C++ got really rusty from all that C# lately, geez. Had to look up all of this to make sure I'm not making mistakes...
If you have a good reason to disagree with the above, please tell me. Thank you.
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
Last Edited: 2013-06-28 18:10:04
June 28 2013 18:09 GMT
#33
You're doing it wrong if you are using the '+' symbol at all.

#include <iostream>
using namespace std;
int add(int x, int y) {
int a, b;
do {
a = x & y;
b = x ^ y;
x = a << 1;
y = b;
}while(a);
return b;
}

int main()
{
cout << add(2,6);
system("pause");
return 0;
}
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 18:25 GMT
#34
wait... what are you trying to do in this code? I got lost at the beginning and then the code just changed into so many different formats that I was like then and finally,
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
June 28 2013 18:29 GMT
#35
On June 29 2013 03:25 3FFA wrote:
wait... what are you trying to do in this code? I got lost at the beginning and then the code just changed into so many different formats that I was like then and finally,

Write it out on paper. These are bitwise operators. It means you manipulate the bits.Convert 2 and 6 in the binary format from decimal and then follow it along.
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 18:31 GMT
#36
On June 29 2013 03:29 BisuDagger wrote:
Show nested quote +
On June 29 2013 03:25 3FFA wrote:
wait... what are you trying to do in this code? I got lost at the beginning and then the code just changed into so many different formats that I was like then and finally,

Write it out on paper. These are bitwise operators. It means you manipulate the bits.Convert 2 and 6 in the binary format from decimal and then follow it along.

Oh binary! I haven't worked with those for a whole year. That explains it. Thanks, I think I understand it now
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
June 28 2013 19:54 GMT
#37
I'm going to have to fix this.

int add(int x, int y) ??<
int a, b;
do <%
a = x bitand y;
b = x ??' y;
x = a << 1;
y = b;
??> while(a);
return b;
%>


And while we're at it, we should create a wrapper class for int, maybe called inT, and only use that instead of the built in type. Then we overload the +, += and ++ operators for great success.
If you have a good reason to disagree with the above, please tell me. Thank you.
Bobbias
Profile Blog Joined March 2008
Canada1373 Posts
June 28 2013 19:56 GMT
#38
On June 29 2013 01:50 3FFA wrote:
Show nested quote +
On June 29 2013 01:21 BisuDagger wrote:
On June 29 2013 00:37 3FFA wrote:
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.

Hehe. Trust me, I'm doing tons of practice in the years ahead. In fact, I'm experimenting with making a tile-based game app at this very moment.


Incidentally, I'm also working on a tile based game at this very moment. Using LÖVE, which is nice, because Lua is a pretty cool language and I don't have to write all the boilerplate code or all the low level opengl stuff just to do 2d rendering. Just found someone's component based entity system and I'm working on building off that.
3FFA
Profile Blog Joined February 2010
United States3931 Posts
June 28 2013 20:37 GMT
#39
On June 29 2013 04:56 Bobbias wrote:
Show nested quote +
On June 29 2013 01:50 3FFA wrote:
On June 29 2013 01:21 BisuDagger wrote:
On June 29 2013 00:37 3FFA wrote:
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.

Hehe. Trust me, I'm doing tons of practice in the years ahead. In fact, I'm experimenting with making a tile-based game app at this very moment.


Incidentally, I'm also working on a tile based game at this very moment. Using LÖVE, which is nice, because Lua is a pretty cool language and I don't have to write all the boilerplate code or all the low level opengl stuff just to do 2d rendering. Just found someone's component based entity system and I'm working on building off that.

Huh. I don't believe I've heard of Lua before. I may check it out sometime in the distant future.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
BisuDagger
Profile Blog Joined October 2009
Bisutopia19284 Posts
June 28 2013 21:07 GMT
#40
On June 29 2013 05:37 3FFA wrote:
Show nested quote +
On June 29 2013 04:56 Bobbias wrote:
On June 29 2013 01:50 3FFA wrote:
On June 29 2013 01:21 BisuDagger wrote:
On June 29 2013 00:37 3FFA wrote:
On June 28 2013 23:44 BisuDagger wrote:
On June 28 2013 22:58 3FFA wrote:
Does it go to the if statement first? I thought it went to the for statement first. >.>

    
BOOL newday = false; //Initialize it to avoid warnings
//YES or NO answers only. I fixed the caps because C++ is character specific

if(newday = YES) //newday has been assigned the value of YES, it will always evaluate to true
{
double TLplus = 9000; //TLPlus is now worth 9000
for (double TL=1; TL < TLplus; TL++) //Make TL a double otherwise you are comparing an int to a double
//loop will attemp to run until TL >= TLplus
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"; //reads the string
printf("/n you are now %i R1CH in TL",TL); //starts a new line and then reads the string,
//using %d allows for morepercision
TLplus ++; //OVER 9000 TL+! Increments TLPlus by 1
newday = NO; //newday is assigned to the value of no
return TL; //you have just exited your code so your for loop did not run over 9000 times. Only Once
//you return the value of Tl which is 1
}
}

See... this is why I got a ton of handwritten quizzes wrong in my programming class this past year >.> I overlook things that the compiler warns me about.

You and me both. When I went through school I bombed all those quizzes. But after all that schooling and practice and a year or so of industry work and you will have a hawks eye for code.

Hehe. Trust me, I'm doing tons of practice in the years ahead. In fact, I'm experimenting with making a tile-based game app at this very moment.


Incidentally, I'm also working on a tile based game at this very moment. Using LÖVE, which is nice, because Lua is a pretty cool language and I don't have to write all the boilerplate code or all the low level opengl stuff just to do 2d rendering. Just found someone's component based entity system and I'm working on building off that.

Huh. I don't believe I've heard of Lua before. I may check it out sometime in the distant future.


Lua is the scripting language blizzard uses to create the UI in WoW. Its one of the most popular along with python. They are really useful tl know.
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
Meta
Profile Blog Joined June 2003
United States6225 Posts
June 28 2013 21:43 GMT
#41
I'm in favor of TLMeta.
good vibes only
Jacmert
Profile Blog Joined October 2011
Canada1709 Posts
June 28 2013 21:44 GMT
#42
On June 28 2013 22:36 BisuDagger wrote:
Show nested quote +
On June 28 2013 21:24 3FFA wrote:
On June 28 2013 20:52 Burrfoot wrote:
I say TL switches things up and upgrades TL+ to +TL+ or started with TL. And incrementally went to TL.. TL... all the way past 9000.s

Ahh so do something like
    
BOOL newday; //is it a new day? Yes or no answers only.

//other code to define newday would most likely go here.

if(newday = YES) // if it is a new day...
{
double TLplus = 9000; //9000 TL+
for (int TL=1; TL < TLplus; TL++) //endless loop is endless
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //Say hi to R1CH
printf("/n you are now %i R1CH in TL",TL); //TL, new currency.
TLplus ++; //OVER 9000 TL+!
newday = NO; //not a new day anymore :(
return TL; //because why not?
}
}


Show nested quote +
//endless loop is endless

Your loop only runs once.

Ha ha! Good, I'm not crazy. I don't usually code in C++ (I work with a C++ like language), but I was like, "doesn't return break out of the loop?"

And I've NEVER heard/known about i++ returning any value, nor the difference between i++ and ++i. Good to know. Thanks!
Plat Support Main #believe
mizU
Profile Blog Joined April 2010
United States12125 Posts
June 28 2013 22:09 GMT
#43
what da fuk is going on
if happy ever afters did exist <3 @watamizu_
Shana
Profile Blog Joined July 2009
Indonesia1814 Posts
June 28 2013 23:48 GMT
#44
So there will be TL++ soon?
Believing in what lies ahead. | That which we call a rose, by any other name would smell as sweet.
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
Last Edited: 2013-06-29 00:59:41
June 29 2013 00:58 GMT
#45
On June 29 2013 02:44 spinesheath wrote:
Show nested quote +
On June 29 2013 02:12 wherebugsgo wrote:
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.

So now instead of

void func(int i) { }
int i = 42;
func(i++);

you always write

void func(int i) { }
int i = 42;
int t;
func((t = i, i += 1, t));

Yes, that's an assignment too, even though there is no = sign in the function call.

Granted, the sequence
vector<int> v(10, 0);
int i = 0;
v[i] = i++;
Can resolve to pretty much anything your compiler wants it to, but is that a reason to avoid ++?

My C++ got really rusty from all that C# lately, geez. Had to look up all of this to make sure I'm not making mistakes...


Actually, I'm almost 100% sure this is exactly why some programmers suggest avoiding ++ and --, because when you use them inline with other things, it tends to confuse people who did not write the code themselves. The professor I had that required += instead of ++ was not the only one who suggested this, though he was the most vocal about it. A few that I've had have said that increment and decrement operators should only be used by themselves on a single line, i.e.


i++;
a[i] = x;


instead of


a[++i] = x;


The fact that you had to look up documentation to see if you were doing everything correctly is another indication that perhaps you should consider simplifying your style, regardless of whether you've spent time programming in C#. Good programming practices lead to simple and readable code. I don't think what you suggested is very simple. Even if it takes more time to write it initially, clean and simple code is much easier and less painful to maintain.

For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.

Then again, maybe I am significantly biased, since the first three languages I learned to program in were Fortran, Scheme, and Python, none of which use the ++ operator. It was only after I used them for 2 years that I moved onto Java and C.
rabidch
Profile Joined January 2010
United States20289 Posts
June 29 2013 01:26 GMT
#46
On June 28 2013 19:20 spinesheath wrote:
The # is actually just two overlapping + signs. So it's C[++ in a single character].

or it could be 4 smaller +s
LiquidDota StaffOnly a true king can play the King.
aNGryaRchon
Profile Joined August 2012
United States438 Posts
June 29 2013 02:39 GMT
#47
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

Good question
Power overwhelming!!!
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-06-29 06:02:12
June 29 2013 06:00 GMT
#48
On June 29 2013 09:58 wherebugsgo wrote:
Show nested quote +
On June 29 2013 02:44 spinesheath wrote:
On June 29 2013 02:12 wherebugsgo wrote:
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.

So now instead of

void func(int i) { }
int i = 42;
func(i++);

you always write

void func(int i) { }
int i = 42;
int t;
func((t = i, i += 1, t));

Yes, that's an assignment too, even though there is no = sign in the function call.

Granted, the sequence
vector<int> v(10, 0);
int i = 0;
v[i] = i++;
Can resolve to pretty much anything your compiler wants it to, but is that a reason to avoid ++?

My C++ got really rusty from all that C# lately, geez. Had to look up all of this to make sure I'm not making mistakes...


Actually, I'm almost 100% sure this is exactly why some programmers suggest avoiding ++ and --, because when you use them inline with other things, it tends to confuse people who did not write the code themselves. The professor I had that required += instead of ++ was not the only one who suggested this, though he was the most vocal about it. A few that I've had have said that increment and decrement operators should only be used by themselves on a single line, i.e.


i++;
a[i] = x;


instead of


a[++i] = x;


The fact that you had to look up documentation to see if you were doing everything correctly is another indication that perhaps you should consider simplifying your style, regardless of whether you've spent time programming in C#. Good programming practices lead to simple and readable code. I don't think what you suggested is very simple. Even if it takes more time to write it initially, clean and simple code is much easier and less painful to maintain.

For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.

Then again, maybe I am significantly biased, since the first three languages I learned to program in were Fortran, Scheme, and Python, none of which use the ++ operator. It was only after I used them for 2 years that I moved onto Java and C.

I had to look this stuff up because things like the comma operator are pretty damn exotic and I would never use them in real code unless I had a very specific reason to use it. Also to make sure the example of undefined behavior is actually undefined behavior.
Increment operators are generally fine if you only have a single occurence of the incremented variable in the whole statement and don't have any side effects on the variable. Sure, it means you need to be careful, but in fact compilers should be able to warn you about these things nowadays and I wouldn't give up proper ++ usage (which really is just in cases where it is clear what it does) where appropriate just for a little false security. You're not allowed to be any less careful just because you avoid ++, anyways.
If you have a good reason to disagree with the above, please tell me. Thank you.
Mobius_1
Profile Blog Joined April 2011
United Kingdom2763 Posts
June 29 2013 08:23 GMT
#49
doubleplus? Are we at war with Eastasia or Eurasia?
Starleague Forever. RIP KT Violet~
docvoc
Profile Blog Joined July 2011
United States5491 Posts
June 29 2013 15:38 GMT
#50
On June 28 2013 15:49 CecilSunkure wrote:
u gotta skate

The moral of the story.
User was warned for too many mimes.
Scorpion77
Profile Blog Joined January 2013
98 Posts
June 30 2013 17:41 GMT
#51
idk, this sounds like it would disturb the fabric of the metagame
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-06-30 22:29:28
June 30 2013 22:27 GMT
#52
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

=.=

-removed comment-
There is no one like you in the universe.
MaGariShun
Profile Joined May 2010
Austria305 Posts
July 01 2013 15:28 GMT
#53
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

Because calling it 'Java' would have been to obvious of a ripoff
XCetron
Profile Joined November 2006
5226 Posts
July 01 2013 16:15 GMT
#54
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

[image loading]
Rayeth
Profile Blog Joined April 2010
United States883 Posts
July 01 2013 21:07 GMT
#55
On June 29 2013 09:58 wherebugsgo wrote:


For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.


I can show off my knowledge of old languages, whee!


i = i++ + ++i;

This is straight up undefined behavior by the C standard. I don't know about C++ or C# (as I don't use them), but the C standard says this will lead to undefined behavior. You are using the ++ operator in such a way as to make its use dependant on what the compiler chooses to do first. It is equally undefined to say:

u = u++;


Now something will happen, but what you get is dependent on what system, what compiler and who knows how many other variables. The correct way to write the above would simply be u++;

The technical reason for these being incorrect is that you are modifying the stored value more than once between sequence points. As for what a sequence point is refer to the Wikipedia article as it is much clearer than I could ever be. The end result here is that you are right. No one should ever use expressions like that. They are sometimes used in classrooms to demonstrate bad code for a reason!

I will disagree with you about the pointers though. Yes bad code can be created using silly means, but a competent coder should not fear to use pointers. They are really useful! Don't shy away from such a powerful tool because they can be confusing, just make sure you are not the one writing the bad code. =)
The Innocent shall suffer... big time.
Targe
Profile Blog Joined February 2012
United Kingdom14103 Posts
July 01 2013 22:26 GMT
#56
u gotta skate

+ Show Spoiler +
this thread hurts my head
11/5/14 CATACLYSM | The South West's worst Falco main
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
July 02 2013 01:00 GMT
#57
On July 02 2013 07:26 Targe wrote:
u gotta skate

hahaha, I wonder if anyone got the baller reference in there too
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
Last Edited: 2013-07-06 01:17:43
July 06 2013 01:13 GMT
#58
On July 02 2013 06:07 Rayeth wrote:
Show nested quote +
On June 29 2013 09:58 wherebugsgo wrote:


For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.


I can show off my knowledge of old languages, whee!


i = i++ + ++i;

This is straight up undefined behavior by the C standard. I don't know about C++ or C# (as I don't use them), but the C standard says this will lead to undefined behavior. You are using the ++ operator in such a way as to make its use dependant on what the compiler chooses to do first. It is equally undefined to say:

u = u++;


Now something will happen, but what you get is dependent on what system, what compiler and who knows how many other variables. The correct way to write the above would simply be u++;

The technical reason for these being incorrect is that you are modifying the stored value more than once between sequence points. As for what a sequence point is refer to the Wikipedia article as it is much clearer than I could ever be. The end result here is that you are right. No one should ever use expressions like that. They are sometimes used in classrooms to demonstrate bad code for a reason!

I will disagree with you about the pointers though. Yes bad code can be created using silly means, but a competent coder should not fear to use pointers. They are really useful! Don't shy away from such a powerful tool because they can be confusing, just make sure you are not the one writing the bad code. =)


I never once said that a good programmer should not use pointers. I use pointers all the time, I just don't necessarily increment them using ++.

edit: btw, I used those examples because I've actually seen them in codebases.

yep, that's right. I have seen real code written by real people that looks that confusing.
Normal
Please log in or register to reply.
Live Events Refresh
Safe House 2
18:00
Qualifier #2
ZombieGrub454
LiquipediaDiscussion
[BSL 2025] Weekly
18:00
#17
ZZZero.O74
Terrorterran14
LiquipediaDiscussion
PSISTORM Gaming Misc
15:55
FSL Team League: PTB vs ASH
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ZombieGrub454
ProTech114
BRAT_OK 63
Codebar 47
Vindicta 33
Nathanias 24
MindelVK 24
gerald23 15
StarCraft: Brood War
Mini 1127
Shuttle 926
sSak 258
firebathero 180
Dewaltoss 89
ZZZero.O 74
Backho 44
Rock 36
Mong 33
soO 32
[ Show more ]
ivOry 25
Movie 21
Hm[arnc] 15
Terrorterran 14
Jaeyun 7
Dota 2
Gorgc7123
capcasts21
Counter-Strike
fl0m3507
Stewie2K165
Heroes of the Storm
Liquid`Hasu539
Khaldor459
Other Games
FrodaN2254
Grubby1911
B2W.Neo684
Beastyqt597
Skadoodle204
ToD191
ArmadaUGS94
Trikslyr68
Organizations
Other Games
EGCTV1178
gamesdonequick676
BasetradeTV65
StarCraft 2
angryscii 23
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• printf 57
• StrangeGG 42
• Airneanach18
• 3DClanTV 13
• Hupsaiya 2
• AfreecaTV YouTube
• intothetv
• Kozan
• sooper7s
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Michael_bg 7
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Other Games
• imaqtpie965
• WagamamaTV446
• Shiphtur291
Upcoming Events
Sparkling Tuna Cup
15h 15m
Map Test Tournament
16h 15m
TBD vs Spirit
TBD vs herO
OSC
17h 15m
IPSL
1d
Bonyth vs Art_Of_Turtle
Razz vs rasowy
Afreeca Starleague
1d 15h
Barracks vs Snow
Afreeca Starleague
2 days
Soma vs Bisu
The PondCast
4 days
CranKy Ducklings
6 days
Safe House 2
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
Maestros of the Game
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
WardiTV TLMC #15
EC S1
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.