2spooky2play
2spooky2play
CC#
Created by SafiraG on 7/6/2024 in #help
Snake Game C# in Godot
i think you will have better results there
11 replies
CC#
Created by SafiraG on 7/6/2024 in #help
Snake Game C# in Godot
$godot
11 replies
CC#
Created by - Stronzo- on 7/5/2024 in #help
✅ Console.WriteLine("a") isn't showing "a" in console but "Hello, World!"
just in case
12 replies
CC#
Created by - Stronzo- on 7/5/2024 in #help
✅ Console.WriteLine("a") isn't showing "a" in console but "Hello, World!"
$helloworld
12 replies
CC#
Created by - Stronzo- on 7/5/2024 in #help
✅ Console.WriteLine("a") isn't showing "a" in console but "Hello, World!"
compile it again
12 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
ask someone in #advanced maybe?
26 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
linq is lazy, so i doubt it allocates
26 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
var result = numbers.Where(num => num > 100).Reverse().Take(3) is all you need
26 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
its a long story, but 1) its slower (iirc) 2) it requires an allocated list (sometimes you dont need to allocate)
26 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
the last Reverse().ToArray() seems unnecessary
26 replies
CC#
Created by Jason_Bjorn on 6/27/2024 in #help
LINQ help
ForEach really sucks, dont use it
26 replies
CC#
Created by ~Linc~ on 5/9/2024 in #help
Can Someone help me fix this messy code and simplify it.
public List<Slot> FuelSlots = new List<Slot>();
public List<Slot> InputSlots = new List<Slot>();
public List<Slot> OutputSlots = new List<Slot>();
public List<Slot> FuelSlots = new List<Slot>();
public List<Slot> InputSlots = new List<Slot>();
public List<Slot> OutputSlots = new List<Slot>();
you already have these lists, why not use those?
9 replies
CC#
Created by ~Linc~ on 5/9/2024 in #help
Can Someone help me fix this messy code and simplify it.
you can probably use a loop to store and get the slots
9 replies
CC#
Created by 2spooky2play on 5/2/2024 in #help
Branching paths for a text based adventure game (language agnostic)
so with that idea it would be more like
Location location = GetNextLocationFromInput();
location.ResolveEvents()
Location location = GetNextLocationFromInput();
location.ResolveEvents()
?
16 replies
CC#
Created by 2spooky2play on 5/2/2024 in #help
Branching paths for a text based adventure game (language agnostic)
ah ok
16 replies
CC#
Created by 2spooky2play on 5/2/2024 in #help
Branching paths for a text based adventure game (language agnostic)
looking up its code doesnt get me anywhere
16 replies
CC#
Created by 2spooky2play on 5/2/2024 in #help
Branching paths for a text based adventure game (language agnostic)
static class Input {
public static string? GetInput(string prompt) {
Console.Write($"{prompt}: ");

return Console.ReadLine()?
.Trim()?
.ToLower();
}
}

static class TestWorld {
public static void Shop() {
Console.WriteLine("Welcome to the shop");
}

public static void Arena() {
Console.WriteLine("Welcome to the arena");
}
}

class Program {
static void Main() {
var userInput = Input.GetInput("shop or arena?")!;
var place = userInput switch {
"shop" => TestWorld.Shop,
"arena" => TestWorld.Arena,
_ => throw new Exception(),
};
place();
}
}
static class Input {
public static string? GetInput(string prompt) {
Console.Write($"{prompt}: ");

return Console.ReadLine()?
.Trim()?
.ToLower();
}
}

static class TestWorld {
public static void Shop() {
Console.WriteLine("Welcome to the shop");
}

public static void Arena() {
Console.WriteLine("Welcome to the arena");
}
}

class Program {
static void Main() {
var userInput = Input.GetInput("shop or arena?")!;
var place = userInput switch {
"shop" => TestWorld.Shop,
"arena" => TestWorld.Arena,
_ => throw new Exception(),
};
place();
}
}
No best type was found for the switch expression.
No best type was found for the switch expression.
i have no idea what this error means
16 replies
CC#
Created by 2spooky2play on 5/2/2024 in #help
Branching paths for a text based adventure game (language agnostic)
ima experiment with that and come back to you
16 replies