« first day (1009 days earlier)      last day (3012 days later) » 
00:00 - 23:0023:00 - 00:00

11:12 PM
@Vogel612 lol...
 
Why has this question verbatim appeared on gamedev and code review? The username used there is different (SamBh) — ChrisWue 59 secs ago
 
the argumentation result isn't necessarily wrong, the argument chosen is the wrong one :/
on a related note... someone here knows what exactly is a "homicide argument"?
 
11:34 PM
0
Q: How is my downheap algorithm?

moominI am attempting to downheap on an array from the last interior node all the way up to the root, so that I am making mini-heaps from the bottom up. I have an algorithm that I believe will do this though I far from 100% certain at this point. Aside from the fact that I cannot get this to work due ...

0
Q: How to make a connect 4 grid in c#

user96992Hello everyone as my coursework for Software Systems Development I have been asked to create a game. I have chosen to make connect 4 and currently I have been stuck on how to make the grid for the board in the game. I have been looking at other forums but I just don't understand them. Can anyone ...

 
@CaptainObvious This is broken code according to OP...
 
@Matt @Quill Are either of you around?
 
yo
 
I'm having trouble with my PowerShell.
The web says that "break" will break out of a loop.
It is breaking out of every loop I'm in over here, actually.
do {
    PlayGame 1 100 6
} while (PlayAgain)
If ($guess -eq $secretNum) {
    Write-Host "Correct!"
    $exit = $true
    break
}
Isn't it just supposed to break out of the first loop?
 
11:50 PM
can't you just set PlayAgain to be false
 
That isn't the point.
I want to exit the current game back to the prompt when I guess the correct number.
 
try using return
 
That actually does nothing at all.
 
Is the latter part within the PlayGame function? In other words, is the break at another scope?
 
It actually never did, but I figured that would be a "feature" of my question. You guys confirmed that it should work.
Yeah.
Function PlayGame([int]$min, [int]$max, [int]$guessNumber) {
    Write-Host "This is a guess-the-number game.
You have 6 guesses to guess a number between 1 and 100.`r`n"

    [int]$secretNum = Get-Random -minimum $min -maximum ($max + 1)

    [bool]$exit = $false

    1..$guessNumber | :guessLoop ForEach {
        [int]$guess = Get-ValidGuess $min $max

        If ($exit) { continue }

        If ($guess -eq $secretNum) {
            Write-Host "Correct!"
            $exit = $true
            break guessLoop
 
11:52 PM
hmm, SO seems to think Powershell loops are weird
 
That is the entire function.
I'm currently getting around it with continue, which appears to work.
 
64
A: Why does continue behave like break in a Foreach-Object?

Roman KuzminSimply use the return instead of the continue. This return returns from the script block which is invoked by ForEach-Object on a particular iteration, thus, it simulates the continue in a loop. 1..100 | ForEach-Object { if ($_ % 7 -ne 0 ) { return } Write-Host "$($_) is a multiple of 7" ...

whoops wrong one
 
Oh wow. That is what was happening!
 
^^ Maybe correct... The ForEach can be broken, but the loop not...
Could possibly be solved if you are able to name the outer loop (the outer part of the pipeline), but haven't used PowerShell actively...
 
Wow. Continue breaks out of the foreach, Return acts as a normal Continue, and Break does I-don't-know-what.
3
 
11:56 PM
21
Q: What team member SO Activity should we gather and show on Teams?

HynesFor those who don't know me, I'm a product designer at Stack Overflow, working on the Teams product. If you need a background on Teams, read this awesome post from Tim. We're at a point with Teams where can begin exploring different content ideas, and I wanted to share one idea with you: Team St...

 
(The name of a method's receiver should be a reflection of its identity; often a one or two letter abbreviation of its type suffices (such as "c" or "cl" for "Client"). Don't use generic names such as "me", "this" or "self", identifiers typical of object-oriented languages that place more emphasis on methods as opposed to functions. )[github.com/golang/go/wiki/CodeReviewComments#receiver-names]OneOfOne 22 secs ago
 
Continue skips the foreach, and since the exit is now true, it continues to do so until the pipeline is emptied. Break only breaks the current inner loop, once, and not the entire pipeline. At least that is how I read it!
 
00:00 - 23:0023:00 - 00:00

« first day (1009 days earlier)      last day (3012 days later) »