Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8822039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:00:02+00:00 2026-06-14T06:00:02+00:00

I am a beginner and have been playing around with C#. I have recently

  • 0

I am a beginner and have been playing around with C#. I have recently written the code for the very popular ‘Cows and Bulls’ word game. Its working for 2 players i.e; One player thinks of a word and the other person has to guess it. I am giving only 10 chances for guessing.

I now want to make the game for a single player(Computer v Human). I was wondering if there was anyway of getting all the 4 letter words in the English Language without Letter repetition(I have limited the game to 4 Letter words only). I know I can use an Enumeration and write down all the 4 letter words. But that’s Hard Coding the Words. That would be my last option.I could type all the words in,but I would then have some idea of the word if I play the game.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:00:06+00:00Added an answer on June 14, 2026 at 6:00 am

    Assuming you have a list of words called words list

    You can use regex to select 4 letter unique words

     List<string> 4letterUniqueWords=words
    .Where(x=>Regex.IsMatch(x,"^(?=^[a-zA-Z]{4}$)(?!^.*?(.).*?\1.*?$).*?$"))
    .Select(y=>y)
    .ToList<string>();
    

    ^(?=^[a-zA-Z]{4}$)(?!^.*?(.).*?\1.*?$).*?$
      ---------------  ------------------ ---
            |                  |           |->matches if both the lookaheads are true
            |                  |->checks if there are any repeating words
            |->checks if the words contains 4 letter alphabetic words
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a Haskell beginner and I've been playing around with point-free functions. I have
I'm a Java beginner and have been futzing around with various solutions to this
I am a beginner to RoR and have been doing some coding recently myself
I am a very new beginner and have been reading the help forums. All
I'm a rails beginner and have been several hours now trying to figure out
I am a beginner with MSBuild. So far I have been able to create
I am a beginner to C++ and SDL, but I have been developing games
i am a beginner and i have a problem : this code doesnt compile
I have been programming in C++ for a while but I am a beginner
I am a beginner interested in Haskell, and I have been trying to implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.