• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:14
CEST 14:14
KST 21:14
  • 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 - Finalists & Open Tournaments1[ASL20] Ro16 Preview Pt2: Turbulence10Classic Games #3: Rogue vs Serral at BlizzCon9[ASL20] Ro16 Preview Pt1: Ascent10Maestros of the Game: Week 1/Play-in Preview12
Community News
StarCraft II 5.0.15 PTR Patch Notes146BSL 2025 Warsaw LAN + Legends Showmatch2Weekly Cups (Sept 8-14): herO & MaxPax split cups4WardiTV TL Team Map Contest #5 Tournaments1SC4ALL $6,000 Open LAN in Philadelphia8
StarCraft 2
General
StarCraft II 5.0.15 PTR Patch Notes Why Storm Should NOT Be Nerfed – A Core Part of Pr #1: Maru - Greatest Players of All Time Team TLMC #5 - Finalists & Open Tournaments Team Liquid Map Contest #21 - Presented by Monster Energy
Tourneys
RSL: Revival, a new crowdfunded tournament series Stellar Fest KSL Week 80 StarCraft Evolution League (SC Evo Biweekly) SC2's Safe House 2 - October 18 & 19
Strategy
Custom Maps
External Content
Mutation # 491 Night Drive Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around
Brood War
General
Soulkey on ASL S20 ASL20 General Discussion BW General Discussion Diplomacy, Cosmonarchy Edition ASL TICKET LIVE help! :D
Tourneys
[ASL20] Ro16 Group D BSL 2025 Warsaw LAN + Legends Showmatch [ASL20] Ro16 Group C Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Borderlands 3 Nintendo Switch Thread General RTS Discussion Thread
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread The Big Programming Thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread UK Politics Mega-thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
BarCraft in Tokyo Japan for ASL Season5 Final The Automated Ban List
Blogs
Too Many LANs? Tournament Ov…
TrAiDoS
i'm really bored guys
Peanutsc
I <=> 9
KrillinFromwales
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1583 users

The Big Programming Thread - Page 847

Forum Index > General Forum
Post a Reply
Prev 1 845 846 847 848 849 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Acrofales
Profile Joined August 2010
Spain18055 Posts
February 18 2017 08:29 GMT
#16921
On February 18 2017 16:40 Hanh wrote:
Show nested quote +
On February 18 2017 16:12 Acrofales wrote:
Re Hahn: it's not true that (1) is a weaker or stronger version of (2). They say completely different things about the set. The original statement says there is no minimum element. (1) says there is a minimum element. (2) says nothing about minima, but instead says there is no maximum element. For instance, (1) is true for the set [0, 1,2], but (2) is not (and neither is the original statement).


OK, but you misquoted me. I wasn't referring to these statements.

Travis:
Show nested quote +

there exists x, such that for all y

and

for all y, there exists x


Me:
Show nested quote +

Not sure what you mean by that, the 1st statement is stronger than the 2nd. (1) is false but (2) is true.


Do you disagree with me?



Still do. They just mean something completely different.

For all dragons, there exists a fairy (that rides it). This is a true statement in our world, because there are no dragons. And thus all of them are indeed ridden by fairies.

There exists a dragon for which all fairies ride it. This is a false statement in our world, because this requires the existence of a dragon.

However:
For all natural numbers x there exists a natural number y != x such that x < y is false. As above, choose x=0 and you have a counterexample.

There is a natural number x, such that for all natural numbers y != x, x < y is true. The natural number for which this holds is x=0.

It's hard to describe this formally without referring to models, but presumably you can piece the rest together yourself? If not I'll give the proof using models this evening. Now I'm going skiing
Hanh
Profile Joined June 2016
146 Posts
Last Edited: 2017-02-18 09:11:57
February 18 2017 09:11 GMT
#16922
Look at the variables.


there exists x, such that for all y

and

for all y, there exists x


They are flipped in the second statement.

For any predicate P(x, y) for which,

If [there is a x for which for all y, P(x, y) is true] then [for all y, there is a x for which P(x, y) is true].

In the first case x cannot depend on y. In the second case it can.




Prillan
Profile Joined August 2011
Sweden350 Posts
February 18 2017 09:27 GMT
#16923
On February 18 2017 18:11 Hanh wrote:
Look at the variables.

Show nested quote +

there exists x, such that for all y

and

for all y, there exists x


They are flipped in the second statement.

For any predicate P(x, y) for which,

If [there is a x for which for all y, P(x, y) is true] then [for all y, there is a x for which P(x, y) is true].

In the first case x cannot depend on y. In the second case it can.


Just wanted to say that this is correct.

(a) exists x. forall y. P(x, y) => (b) forall y. exists x. P(x, y)

Thus, (a) is stronger than (b). It seems Acrofales didn't notice the flipped order of the variables in the quantifications.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Askelad
Profile Joined October 2016
France20 Posts
Last Edited: 2017-02-18 17:59:15
February 18 2017 11:45 GMT
#16924
.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2017-02-18 15:46:28
February 18 2017 15:24 GMT
#16925
On February 18 2017 14:29 dsyxelic wrote:
Show nested quote +
On February 18 2017 10:49 Blitzkrieg0 wrote:
Which node are you actually deleting is probably where you're running into issues.

When you delete the final node in the list your pointer is at position p. p.next is the final node in the list and it's p.next.next value is null. When you set the node at position p's next value to null you're removing the last node in the list as expected and not causing a problem.

HEAD -> [1] -> [2] -> [3] -> [4] -> [5] -> [6] -> [7] -> null


So if I need to delete 7, I want to traverse the list until p.next == 7. p will be at 6. Then I set p.next equal to p.next.next. The resulting list:

HEAD -> [1] -> [2] -> [3] -> [4] -> [5] -> [6] -> null



Consider the difference between delete(value) and delete(pointer). In the latter you've already done the search which is causing the discrepancy. The delete(value) function runs in O(n) time because you must traverse the list to find the node. However, the function signature looks like you're telling it to delete a pointer after you've traversed the list making it a O(1) deletion time. There is no search in the pseudo code.

Same example, but with delete(pointer):
function delete(6)
p=position
p.next = p.next.next


p.next.next is null. Set p.next equal to null and node 7 is removed in constant time.


Hi, thanks for this.
So I guess my confusion comes from my 'end' function not really being the true end of the list.

For example on my list x: 1 -> 2 -> 3 -> 4



I think it makes more sense to have everything based on the idea that you're returning p, but the value p.next is the actual result you're looking for. As long as all your function calls follow this pattern then the data structure makes sense. However, if you like the way you've set it up then it isn't wrong either. This is where documentation becomes important.

Does your list x look like:

A:
 HEAD -> [1] -> [2] -> [3] -> [4] -> null 

B:
 [1] -> [2] -> [3] -> [4] -> null 


Note in the A case that HEAD is a pointer to an empty node that does not contain any data. You'll still have an edge case at the front when you're making a new list, but you're only going to make the list once. You're always going to have these edge cases when you're implementing the data structure. It's more about implementing them in a way that causes the fewest amount of problems.

When the list is empty HEAD is null. When the list is created you create two nodes, the head node and add head.next as the first node. If you do end() on this you return HEAD and have head.next as the end of the list. If you then delete this pointer as per my previous post it will delete the correct node.

Alternately you can always have a list that is pointed to by HEAD. If HEAD.next is null then your list is empty and you need to insert as a special case.

When you're implementing data structures how the code actually works behind the scenes is irrelevant. You have certain methods exposed that are documented to do what they say they do. It is up to the user to utilize them properly.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Buckyman
Profile Joined May 2014
1364 Posts
Last Edited: 2017-02-18 17:18:28
February 18 2017 17:18 GMT
#16926
On February 18 2017 14:29 dsyxelic wrote:

seems fine? though I'm curious how python's default list is so much faster in every way possible


Most python implementations store their lists in a partly full array. Removing an element from the end is as quick as decreasing the 'size' variable, except that if you remove a lot of them it'll copy the remaining list into a smaller array.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-18 18:52:49
February 18 2017 18:50 GMT
#16927
Anyone want to tell me what they think of this C code? I feel like it's pretty well written. To the point. Normally I end up making these small exercises way more convoluted than they need to be. (inb4 i find out it's shit)

the specifications are to take the prototype and implement the function. the function takes the source string and copies it to the results string with leading and trailing whitespace removed. it then records how many spaces were removed into number_of_spaces. You return -1 if there was nothing to copy over.

code:

+ Show Spoiler +


int remove_spaces(const char *source, char *result, int *num_spaces_removed) {
int i = 0;
int j = strlen(source) - 1;
int k = 0;
int z = 0;

if(source == NULL || j == -1) {
return -1;
}


while(source[i]) {
if(source[i] == ' ') {
i++;
continue;
}
break;
}


while(1) {
if(source[j] == ' ') {
j--;
continue;
}
break;
}

for(k=i; k < (j+1); k++) {
printf("%d %d\n", k, j);
result[z] = source[k];
z++;
}

result[z] = '\0';

*num_spaces_removed = (strlen(source) - strlen(result));


return 0;
}


Biolunar
Profile Joined February 2012
Germany224 Posts
February 18 2017 19:12 GMT
#16928
On February 19 2017 03:50 travis wrote:
Anyone want to tell me what they think of this C code? I feel like it's pretty well written. To the point. Normally I end up making these small exercises way more convoluted than they need to be. (inb4 i find out it's shit)

the specifications are to take the prototype and implement the function. the function takes the source string and copies it to the results string with leading and trailing whitespace removed. it then records how many spaces were removed into number_of_spaces. You return -1 if there was nothing to copy over.

code:

+ Show Spoiler +


int remove_spaces(const char *source, char *result, int *num_spaces_removed) {
int i = 0;
int j = strlen(source) - 1;
int k = 0;
int z = 0;

if(source == NULL || j == -1) {
return -1;
}


while(source[i] {
if(source[i] == ' ') {
i++;
continue;
}
break;
}


while(1) {
if(source[j] == ' ') {
j--;
continue;
}
break;
}

for(k=i; k < (j+1); k++) {
printf("%d %d\n", k, j);
result[z] = source[k];
z++;
}

result[z] = '\0';

*num_spaces_removed = (strlen(source) - strlen(result));


return 0;
}


Whoever gave you that prototype is a C rookie.
int *num_spaces_removed
Really? That screams for buggy code on all major 64 bit platforms. Why is that you may ask:
int j = strlen(source) - 1;

if the source string has lenght 0 (i.e. source = ""),
strlen(source) - 1
will wrap around because strlen returns a size_t. So you are basicly asigning SIZE_MAX to j. Please set your compiler warnings higher! The compiler will complain about this line because you are truncating a size_t to an int. Remember: object sizes must be of type size_t!

Other than that I have no clue to what your function is trying to achive. The first two loops are completly unecessary. Just loop once and copy every character from source to dest and skip spaces. You need just two counting variables for both strings.
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-18 19:22:27
February 18 2017 19:22 GMT
#16929
interesting about strlen(source) - 1

As for just looping and copying all non-spaces, that doesn't work because we are not skipping spaces that are inbetween non-space characters. We are only removing trailing and leading whitespace.
Biolunar
Profile Joined February 2012
Germany224 Posts
Last Edited: 2017-02-18 19:31:25
February 18 2017 19:30 GMT
#16930
On February 19 2017 04:22 travis wrote:
interesting about strlen(source) - 1

As for just looping and copying all non-spaces, that doesn't work because we are not skipping spaces that are inbetween non-space characters. We are only removing trailing and leading whitespace.

One loop is still enough. Skip the first spaces until you reach a non space character. Use an index (e.g. size_t end) to remember when you copied the last non space character. Once you are done copying, set source[end] to 0 to cut off the last spaces.
That is part of the reason why that prototype sucks. There is no parameter to specify how large the dest buffer is…
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
Acrofales
Profile Joined August 2010
Spain18055 Posts
February 18 2017 19:56 GMT
#16931
On February 18 2017 18:11 Hanh wrote:
Look at the variables.

Show nested quote +

there exists x, such that for all y

and

for all y, there exists x


They are flipped in the second statement.

For any predicate P(x, y) for which,

If [there is a x for which for all y, P(x, y) is true] then [for all y, there is a x for which P(x, y) is true].

In the first case x cannot depend on y. In the second case it can.






Okay, I see it now. So for starters, and this is more at travis than at you: quantified variables are quantified variables. For all I cared, you could use "cupcake" as your variable name. If the order of your variables are important, make it explicit.

But either way, the claim is still wrong. For the sake of simplicity, I have written it out here:

(1) \exists x \forall y P(x, y)
is stronger than
(2) \forall x \exists y P(y, x)

This is also not true. All we need to do is find a P and a model m such that m \models (1), but m \not\models (2). Right.

Or if you prefer it in your form of implication (2) \rightarrow (1) is false if (1) is false while (2) ist true (which boils down to essentially the same thing, but is less formal.

Here's a simple counter example:

Let X = {a, b} and Y = {a}
R = {(a, a)}

Now:
\forall x \in X \exists y \in Y such that (y, x) \in R

This is false. Counter example: x=b

However:
\exists x \in X \forall y \in Y such that (x, y) \in R
This is true, because it is true for x=a.

Therefore, unless you also make some requirements of the domains of your variables and probably some properties of P, this is definitely not true.

There is an interesting relationship between the two statements. I'm not sure whether your lemma might be true if we restrict x and y to be from the same set. I didn't immediately see a counterexample (but also haven't looked very hard, or tried to construct a proof).

But the sweeping statement you made is still false even when you clarify the switched variables.

+ Show Spoiler +
Thankfully. Would be rather embarrassing for me to be wrong on something like this
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
February 18 2017 19:57 GMT
#16932
On February 19 2017 04:30 Biolunar wrote:
Show nested quote +
On February 19 2017 04:22 travis wrote:
interesting about strlen(source) - 1

As for just looping and copying all non-spaces, that doesn't work because we are not skipping spaces that are inbetween non-space characters. We are only removing trailing and leading whitespace.

One loop is still enough. Skip the first spaces until you reach a non space character. Use an index (e.g. size_t end) to remember when you copied the last non space character. Once you are done copying, set source[end] to 0 to cut off the last spaces.
That is part of the reason why that prototype sucks. There is no parameter to specify how large the dest buffer is…


I actually thought about this way. I thought mine was better(easier, at least). Maybe it's not.
dsyxelic
Profile Joined May 2010
United States1417 Posts
February 18 2017 20:04 GMT
#16933
On February 19 2017 00:24 Blitzkrieg0 wrote:
Show nested quote +
On February 18 2017 14:29 dsyxelic wrote:
On February 18 2017 10:49 Blitzkrieg0 wrote:
Which node are you actually deleting is probably where you're running into issues.

When you delete the final node in the list your pointer is at position p. p.next is the final node in the list and it's p.next.next value is null. When you set the node at position p's next value to null you're removing the last node in the list as expected and not causing a problem.

HEAD -> [1] -> [2] -> [3] -> [4] -> [5] -> [6] -> [7] -> null


So if I need to delete 7, I want to traverse the list until p.next == 7. p will be at 6. Then I set p.next equal to p.next.next. The resulting list:

HEAD -> [1] -> [2] -> [3] -> [4] -> [5] -> [6] -> null



Consider the difference between delete(value) and delete(pointer). In the latter you've already done the search which is causing the discrepancy. The delete(value) function runs in O(n) time because you must traverse the list to find the node. However, the function signature looks like you're telling it to delete a pointer after you've traversed the list making it a O(1) deletion time. There is no search in the pseudo code.

Same example, but with delete(pointer):
function delete(6)
p=position
p.next = p.next.next


p.next.next is null. Set p.next equal to null and node 7 is removed in constant time.


Hi, thanks for this.
So I guess my confusion comes from my 'end' function not really being the true end of the list.

For example on my list x: 1 -> 2 -> 3 -> 4



I think it makes more sense to have everything based on the idea that you're returning p, but the value p.next is the actual result you're looking for. As long as all your function calls follow this pattern then the data structure makes sense. However, if you like the way you've set it up then it isn't wrong either. This is where documentation becomes important.

Does your list x look like:

A:
 HEAD -> [1] -> [2] -> [3] -> [4] -> null 

B:
 [1] -> [2] -> [3] -> [4] -> null 


Note in the A case that HEAD is a pointer to an empty node that does not contain any data. You'll still have an edge case at the front when you're making a new list, but you're only going to make the list once. You're always going to have these edge cases when you're implementing the data structure. It's more about implementing them in a way that causes the fewest amount of problems.

When the list is empty HEAD is null. When the list is created you create two nodes, the head node and add head.next as the first node. If you do end() on this you return HEAD and have head.next as the end of the list. If you then delete this pointer as per my previous post it will delete the correct node.

Alternately you can always have a list that is pointed to by HEAD. If HEAD.next is null then your list is empty and you need to insert as a special case.

When you're implementing data structures how the code actually works behind the scenes is irrelevant. You have certain methods exposed that are documented to do what they say they do. It is up to the user to utilize them properly.


Mine looks like B.

I did not know that (bolded part), that's definitely good to know. I implemented in a way that p gives the actual result besides end(). I guess ideally I would have everything consistent but again, the book we're using did it with p giving the actual result and apparently didn't account for deletion from the back.

Thanks though you were a lot of help.
TL/SKT
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-18 20:12:23
February 18 2017 20:11 GMT
#16934
sometimes I read stuff in this thread and I am amazed at just how smart you guys are. how much varied stuff you guys know and how precise you are at it. and I wonder to myself "how are these guys not able to work anywhere they want on the cutting edge with this much ability". but then again, maybe you are?

But anyways I read it and am just constantly reminded of how much effort I will have to put in to actually be exceptional in this field, when this is how high the bar is set.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2017-02-18 20:31:09
February 18 2017 20:28 GMT
#16935
On February 19 2017 05:11 travis wrote:
sometimes I read stuff in this thread and I am amazed at just how smart you guys are. how much varied stuff you guys know and how precise you are at it. and I wonder to myself "how are these guys not able to work anywhere they want on the cutting edge with this much ability". but then again, maybe you are?

But anyways I read it and am just constantly reminded of how much effort I will have to put in to actually be exceptional in this field, when this is how high the bar is set.

You see a dozen or more people showing off their knowledge in their respective fields of expertise. You especially don't see people answering with an unhelpful and slightly embarassing "I don't know". You don't need to be exceptionally smart to be good at a couple of things. With actual job experience you also learn a couple of things in detail, often the hard way. That kind of stuff tends to burn itself into your mind.

But yes, this software as a job is not something where you learn stuff once and then stop putting in effort.
If you have a good reason to disagree with the above, please tell me. Thank you.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2017-02-18 20:30:53
February 18 2017 20:30 GMT
#16936
Gee why do I keep using quote instead of edit...
If you have a good reason to disagree with the above, please tell me. Thank you.
slmw
Profile Blog Joined October 2010
Finland233 Posts
February 18 2017 20:38 GMT
#16937
On February 19 2017 04:57 travis wrote:
Show nested quote +
On February 19 2017 04:30 Biolunar wrote:
On February 19 2017 04:22 travis wrote:
interesting about strlen(source) - 1

As for just looping and copying all non-spaces, that doesn't work because we are not skipping spaces that are inbetween non-space characters. We are only removing trailing and leading whitespace.

One loop is still enough. Skip the first spaces until you reach a non space character. Use an index (e.g. size_t end) to remember when you copied the last non space character. Once you are done copying, set source[end] to 0 to cut off the last spaces.
That is part of the reason why that prototype sucks. There is no parameter to specify how large the dest buffer is…


I actually thought about this way. I thought mine was better(easier, at least). Maybe it's not.


I think with C you need to put a lot of effort into making your code as simple as possible, since the language offers very little help. Fewer moving parts should make the code a lot easier to read. Try to cut as many extra lines of code as long as it also makes the code somewhat more readable. A common pattern in string handling is to simply loop until str[i]==0, instead of using strlen to avoid extra passes. Another common trick is to use a[i++] = b[j++] for copying a string.

With a single pass the code becomes quite a bit shorter:

int i = 0, j = 0, end_pos = 0;
for(i=0;source[i]!=0;i++) {
bool space = source[i]==' ';
if(j || !space ) {
if(!space) end_pos = j+1;
result[j++] = source[i];
}
}
result[end_pos] = 0;
*num_spaces_removed = i-end_pos;
return (i-end_pos) == 0 ? -1 : 0;


You can do two passes in a similar manner:
int j = 0, last_char = -1, len = 0;
for(len=0;source[len]!=0;len++) if(source[len]!=' ') last_char = len;
for(int i=0;i<=last_char;i++) {
if(j || source[i] != ' ') {
result[j++] = source[i];
}
}
result[j] = 0;
*num_spaces_removed = len-j;
return (len-j) == 0 ? -1 : 0;


A lot of this is of course subjective, verbose code might be easier to read for some people. At least after doing a lot of string processing in pure C this style should become easier to read.


Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
February 18 2017 20:52 GMT
#16938
slmw could you explain


bool space = source[i]==' ';


is "bool" in a certain library in C? I was under the impression C doesn't have a boolean type.

What is the syntax here?

bool name = [ statement ] ?
it's syntax is weird to me
Acrofales
Profile Joined August 2010
Spain18055 Posts
February 18 2017 21:04 GMT
#16939
C99 has bools.

as for the use, it's

bool name = <something boolean>

could be

bool stopyet = false;
<do stuff>
stopyet = true;
if (stopyet) {
exit(0);
}


or as slmw wrote, some statement that evaluates to true/false. I would put it between brackets,though. I hate depending on non-obvious precedence between operators for my code to work. Does C parser parse that as:

(bool space = source[i]) == ' '; //gibberish
or
bool space = (source[i] == ' '); //what you want: assigns the outcome of the comparison to your newly declared bool.

If assignment were to have a higher precedence than comparison, C parser would give you the former, which at best wouldn't compile (haven't tested). But that's just personal preference for the style, perhaps if I was more familiar with C, I wouldn't be bothered by it.
tofucake
Profile Blog Joined October 2009
Hyrule19087 Posts
February 18 2017 21:52 GMT
#16940
On February 19 2017 05:30 spinesheath wrote:
Gee why do I keep using quote instead of edit...

It gets even more annoying when you can edit any post...
Liquipediaasante sana squash banana
Prev 1 845 846 847 848 849 1031 Next
Please log in or register to reply.
Live Events Refresh
RSL Revival
10:00
Season 2: Playoffs Day 7
Cure vs ZounLIVE!
Tasteless1253
Crank 1116
IndyStarCraft 228
CranKy Ducklings104
Rex103
3DClanTV 46
IntoTheiNu 19
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 1253
Crank 1116
IndyStarCraft 228
Rex 103
MindelVK 38
Railgan 26
StarCraft: Brood War
Britney 44101
Calm 7883
Rain 2649
Horang2 2266
Flash 2062
GuemChi 1160
EffOrt 818
Larva 536
BeSt 467
actioN 423
[ Show more ]
Hyuk 315
Hyun 286
Zeus 206
Last 193
firebathero 182
Soma 114
Rush 113
ZZZero.O 92
Aegong 90
Light 85
Soulkey 69
sSak 67
Sharp 65
Free 58
ajuk12(nOOB) 56
Nal_rA 46
Movie 41
Mong 39
soO 34
sas.Sziky 31
Sacsri 29
Sexy 27
ivOry 21
Icarus 17
Hm[arnc] 10
Terrorterran 4
Noble 3
Dota 2
singsing2890
Gorgc2340
qojqva1380
Dendi1218
XcaliburYe734
Fuzer 207
Counter-Strike
allub268
Heroes of the Storm
Khaldor183
Other Games
B2W.Neo1050
DeMusliM495
crisheroes374
Lowko175
Hui .144
NeuroSwarm45
Trikslyr24
Organizations
Other Games
gamesdonequick713
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1883
• Stunt552
Other Games
• WagamamaTV269
Upcoming Events
BSL Open LAN 2025 - War…
2h 46m
OSC
8h 46m
BSL Open LAN 2025 - War…
19h 46m
RSL Revival
21h 46m
Classic vs TBD
WardiTV Invitational
22h 46m
Online Event
1d 3h
Wardi Open
1d 22h
Monday Night Weeklies
2 days
Sparkling Tuna Cup
2 days
LiuLi Cup
3 days
[ Show More ]
The PondCast
4 days
CranKy Ducklings
5 days
Liquipedia Results

Completed

Proleague 2025-09-10
Chzzk MurlocKing SC1 vs SC2 Cup #2
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
2025 Chongqing Offline CUP
BSL World Championship of Poland 2025
RSL Revival: Season 2
Maestros of the Game
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
FISSURE Playground #1

Upcoming

IPSL Winter 2025-26
BSL Season 21
SC4ALL: Brood War
BSL 21 Team A
Stellar Fest
SC4ALL: StarCraft II
EC S1
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
ESL Pro League S22
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.