az89f 4hfyr k8y2z b9y6d f4yse rhr9d 3a3z9 7nhd8 3r7hb skbbe ei835 ddatd dfd65 d4en6 dbhak ks2ny 6y64h z6n2k s4yzz n4ktd e2fr2 Why is my code not looping? |

Why is my code not looping?

2022.01.23 02:20 davidadam_ Why is my code not looping?

I'm trying to use a while loop to check whether its the player's turn but it only goes through one cycle. I cannot understand why my conditions are not being met?

class Program { static void Main(string[] args) { Console.WriteLine("Test program: Hero vs Enemy"); Console.WriteLine("Press Key to generate a Hero"); Console.ReadKey(); Hero Hero1 = new("john"); Console.WriteLine(); Foe Foe1 = new("Evil john"); Console.WriteLine(); /* Hero1.printStats(); Console.WriteLine(); Foe1.printStats(); Console.WriteLine(); */ bool heroTurn = true; while (Hero1.hitPoints > 0 && Foe1.hitPoints > 0 && heroTurn == true) { Console.WriteLine("What will you do? \n (f)ight (h)eal"); string choice = Console.ReadLine(); switch (choice) { case "f": Hero1.Attack(Foe1); Hero1.printStats(); Console.WriteLine(); Foe1.printStats(); heroTurn = Combat.turnControl(heroTurn); break; case "h": Hero1.Heal(); Hero1.printStats(); Console.WriteLine(); Foe1.printStats(); heroTurn = Combat.turnControl(heroTurn); break; default: //return invalid option, ask for choice again break; } } while (Hero1.hitPoints > 0 && Foe1.hitPoints > 0 && heroTurn == false) { //ai makes choice to attack Foe1.Attack(Hero1); Hero1.printStats(); Foe1.printStats(); heroTurn = Combat.turnControl(heroTurn); } while (Hero1.hitPoints > 0 && Foe1.hitPoints < 0) { //method to state hero wins Console.WriteLine("John wins"); } while (Hero1.hitPoints < 0 && Foe1.hitPoints > 0) { //method to state foe wins Console.WriteLine("Evil John wins"); } } } class Character { public int maxHP; public string name; protected int _hitPoints; public int hitPoints { get { return _hitPoints; } set { _hitPoints = value; } } protected int _attackStat; public int attackStat { get { return _attackStat; } } public Random rdm = new Random(); public void Attack(Character other) { Console.WriteLine(); other.hitPoints -= this.attackStat; Console.WriteLine(other.name + " took " + this.attackStat + " damage!"); } public void Heal() { Console.WriteLine(); int healAmount = rdm.Next(10, 20); hitPoints += healAmount; if (hitPoints > maxHP) { hitPoints = maxHP; } Console.WriteLine(name + " recovered " + healAmount + "HP"); } public void printStats() { Console.WriteLine("Name: " + name); Console.WriteLine("=========="); Console.WriteLine("HP: " + hitPoints); Console.WriteLine("Atk: " + attackStat); } } class Hero : Character { public Hero(string _name) { name = _name; _hitPoints = rdm.Next(20, 26); maxHP = _hitPoints; Console.WriteLine("Hero: " + name); Console.WriteLine("HP: " + hitPoints); _attackStat = rdm.Next(10, 16); Console.WriteLine("Attack: " + attackStat); } } class Foe : Character { public Foe(string _name) { name = _name; _hitPoints = rdm.Next(18, 24); maxHP = _hitPoints; Console.WriteLine("Foe: " + name); Console.WriteLine("HP: " + hitPoints); _attackStat = rdm.Next(8, 12); Console.WriteLine("Attack: " + attackStat); } } class Combat { public static bool turnControl(bool heroturn) //toggle boolvalue between true or false { if (heroturn == true) { heroturn = false; return heroturn; //if heroturn is "true", set heroturn to false } else { heroturn = true; return heroturn; //since heroturn is not equal to true, it is equal to false. Set heroturn to true } } } 
submitted by davidadam_ to learnprogramming [link] [comments]


2022.01.23 02:20 visionsofecstasy What advertisement annoys you the most (can be a commercial on TV or just a picture/banner ad online without video)?

submitted by visionsofecstasy to AskReddit [link] [comments]


2022.01.23 02:20 glaurung1 It’s the best

It’s the best submitted by glaurung1 to CHIBears [link] [comments]


2022.01.23 02:20 Dhruviya_Bhalu Fresh Kiwi Honey Chocolate (Cake)

Fresh Kiwi Honey Chocolate (Cake) submitted by Dhruviya_Bhalu to Baking [link] [comments]


2022.01.23 02:20 swagNextTuber 49ers stun top-seeded Packers, advance to NFC Championship

49ers stun top-seeded Packers, advance to NFC Championship submitted by swagNextTuber to TrendingQuickTVnews [link] [comments]


2022.01.23 02:20 yeah_so_no Going to look at potential first VW. But I’m concerned.

I’m going to look at a 2015 Tiguan on Monday, but now a friend has me somewhat concerned about electrical issues in VWs. Should I be? It’s got about 65k on it.
submitted by yeah_so_no to Volkswagen [link] [comments]


2022.01.23 02:20 SouthernVaper I've been running with this look for both teams for a while, thoughts?

I've been running with this look for both teams for a while, thoughts? submitted by SouthernVaper to RLFashionAdvice [link] [comments]


2022.01.23 02:20 theSpeciamOne le cringe

le cringe submitted by theSpeciamOne to quacklore [link] [comments]


2022.01.23 02:20 aaronframe21 Just moved to Tennessee, first bet first win! (Im nee to sport betting so i tried to play it safe, but hey, it worked out!)

Just moved to Tennessee, first bet first win! (Im nee to sport betting so i tried to play it safe, but hey, it worked out!) submitted by aaronframe21 to sportsbetting [link] [comments]


2022.01.23 02:20 Firm-Indication6150 Epk have so much orleans kids that ain’t on shit but be talking the most

submitted by Firm-Indication6150 to Ottawalogy [link] [comments]


2022.01.23 02:20 Duyan--- Servers up?

Servers up? i use to not even be able to get in the lobbies but now i can find a match? am i just lucky or did they kinda fix the servers?
submitted by Duyan--- to titanfall [link] [comments]


2022.01.23 02:20 swagNextTuber Democrats bend facts 'to fit whatever narrative they need to keep their power': Bongino

Democrats bend facts 'to fit whatever narrative they need to keep their power': Bongino submitted by swagNextTuber to TrendingQuickTVnews [link] [comments]


2022.01.23 02:20 TurnoverUpstairs What is bairon doing right now?

Last what I heard of him was when he travelled with Arthur and guruon.
submitted by TurnoverUpstairs to tbatenovel [link] [comments]


2022.01.23 02:20 Toya1988 Warlow

I always felt that Sookie’s grandmother wanted her to be with Bill so badly cause she thought he was Warlow. She didn’t know his name she just knew that her grand daughter was destined to be married off to Vampire. So to me Sookie pursued Bill as her grandmother’s dying wish in a way. I mean…. Am I tripping? Or does that actually make sense?
submitted by Toya1988 to TrueBlood [link] [comments]


2022.01.23 02:20 patrickstarsrock W-2’s

Has anyone in IL gotten W-2’s? Do former employees get them mailed or do we need to get it online…I can’t access the HR site anymore.
submitted by patrickstarsrock to CVS [link] [comments]


2022.01.23 02:20 SergioBoySV Is it possible to reuse a virtual environment for different projects?

I use pycharm to do my coding and I've ended up with multiple projects, each with their own virtual environment, leading to these repetitive files on my computer...
https://imgur.com/a/hwFTluW
Some projects end up using the same modules as other projects, so I was wondering if it's possible to have one virtual environment with say, selenium and pyautogui in it that can be used across multiple projects. This would avoid the clutter shown in the picture. I've searched this question up, but all I seem to find is how to create a venv for an existing project, not a venv with particular modules for particular projects
submitted by SergioBoySV to learnpython [link] [comments]


2022.01.23 02:20 Individual_Green7608 What's up with shows trying to be multi-genre nowadays?

I think this show was set-up really well in the first couple episodes but there was definitely a shift about halfway that really made me dread having to continue watching...i really lose interest when there isn't much plausibility left in the plot...I think this would have much better as a psychological thriller all the way through rather than horror...I mean they do claim it as a horror series but it felt more supernatural, and fantasy which leaves too much to the imagination...I also felt like the whole demonic part of the plot just felt way off and pushed too hard in your face.
I get it though it being based loosely off the podcast but still... reminds me of in her eyes or the oa and I just find myself losing interest after a couple episodes because it just gets too complicated.
submitted by Individual_Green7608 to Archive81 [link] [comments]


2022.01.23 02:20 FairylightKid Kelsey and Stacks :)

Kelsey and Stacks :) submitted by FairylightKid to CraigOfTheCreek [link] [comments]


2022.01.23 02:20 OneWhoGetsBread The Bucktoothed One

The Bucktoothed One submitted by OneWhoGetsBread to pokemonmemes [link] [comments]


2022.01.23 02:20 emma_leigh_28 hey guys

hey guys submitted by emma_leigh_28 to astrologymemes [link] [comments]


2022.01.23 02:20 wuanlai65 Centaurify - ⚡ Launching Now on BSC



CENTAURIFY in a nutshell:
Imagine if TicketMaster was built on a blockchain, with NFTs representing tickets. 100% traceable, impossible to counterfeit, and programmable re-sale conditions that protect both the consumers and the event host.

Centaurify - Tokenizing tickets with NFT & smart contract technology. Your Live Event & Music NFT Universe. With fiat on ramps as well as a music NFT marketplace!

We allow organizers to mint their own NFT-tickets, setting their rules of the smart-contract tokenomics to reward themselves, their artists & their audience on every transaction on the secondary market.

- We allow organizers to set maximum re-sale price to prevent scalping.
- Organizers will secure their audience by using Centurify. NFT-tickets are 100% traceable and are impossible to counterfeit.
- Artists gets fixed 2% automated reflection on every NFT-Ticket transaction from Centaurify.


Link Buy
Contract Address: 0x3abd582AD2221787A5653Bfef2d0A410771a3A39
Pancakeswap: https://pancakeswap.finance/swap?outputCurrency=0x3abd582AD2221787A5653Bfef2d0A410771a3A39

☘️ CLMD (14 platinum awarded DJ) a part of the core team
☘️ Team based in Norway, Sweden, Switzerland and Estonia
☘️ Listed at MEXC and CMC today

✨ Website: https://centaurify.xyz/
✨ Telegram: https://t.me/CentaurifyChat
✨ Twitter: https://twitter.com/CentaurifyBSC
submitted by wuanlai65 to SatoshiBets [link] [comments]


2022.01.23 02:20 NFT4Present The ManusCrypt game

The ManusCrypt game About ManusCrypt
Because of the project team is a supporter of the concept of blockchain technology and cryptocurrencies, the project was created precisely on the blockchain, which makes it possible to exclude the advantage of any of the players in the game and constantly ensure the reliability of the game algorithm, while maintaining equal conditions for all players.
The ManusCrypt project was based on three principles - earnings, training and entertainment. The modern world quickly carries us to the future, and the conditions of modern realities are changing very quickly. Our project was created to teach people to use their intellectual and material resources to the maximum, to bring them closer and acquaint them with blockchain technology and the work of smart contracts, and all this in the format of a dynamic and exciting game!
About the game
The ManusCrypt game belongs to the genre of turn-based economic strategies, where the players have the task of at least not losing and, ideally, constantly increasing their deposit on the volatile and turbulent modern crypto market. In the course of the game, thanks to the non-linear plot and the intervention of random, but very important for the crypto industry events, your deposit will be constantly subject to ups and downs, which will force you to develop your own strategy, which you can then easily transfer to the real world and apply it in the world of real investments.
Enjoy it!
You can familiarize yourself with the smart contract at the link ➡️ https://bscscan.com/token/0xb78fe90960e454f22e66eac1da12a9c67a271fc5
Pre-sale is going https://anyx.app/project/MANUSCRYPT
https://manuscrypt.io/
https://www.reddit.com/ManusCrypt/
t.me/ManusCryptGame_bot?start=97d23745450469ccceace0f1c7229115
https://i.redd.it/pma8kprtgdd81.gif
submitted by NFT4Present to AllCryptoBets [link] [comments]


2022.01.23 02:20 TheNastiestTaxi2 I’m still recovering from this ending, 10 year old me was not ready :’(

submitted by TheNastiestTaxi2 to KingdomHearts [link] [comments]


2022.01.23 02:20 Cowlixthememewatcher Can zombies go in safehouses?

Title.
submitted by Cowlixthememewatcher to projectzomboid [link] [comments]


2022.01.23 02:20 blondebitch4life To one of my neighbors at ISR

Please stop being extremely loud.
No one thinks “wow… they’re having so much fun 🤩 I bet they’re so cool!”
And I thought maybe that would hit, seeing as the RA who you KNOW lives right across from you has to ask you to be quiet every. Single. Night.
Do you understand no one appreciates that? And that makes people not like you?
Some of us actually came to college to do work. Not to party 24/7.
And if you want to, go to a frat. Or outside. Or to a bar.
But not next to me when its 11pm and I’m trying to sleep or work.
I know it’s hard learning to be respectful, and you’re not the only one on the planet, but it’s a part of growing up.
And you might want to grow up sooner or later.
submitted by blondebitch4life to UIUC [link] [comments]


http://granetta.ru