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 7853853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:49:47+00:00 2026-06-02T19:49:47+00:00

basically, given n, eg 3, how can i create a list of values of

  • 0

basically, given n, eg 3, how can i create a list of values of all combination of T and F

eg. for n = 3, (make-bools 3) should return ((T T T), (T T F), … (F F F))

This is similar to question Function to return all combinations of n booleans? but to implement in scheme

  • 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-02T19:49:49+00:00Added an answer on June 2, 2026 at 7:49 pm

    Not the most efficient:

    (define (make-bools n)
      (if (= n 0)
        '()
        (append (addhead 'T (make-bools (- n 1)))
                (addhead 'F (make-bools (- n 1))))))
    
    ; Yield copy of l with h added on to head of each list in l
    (define (addhead h l)
      (if (null? l)
          l
          (cons (cons h (car l)) (addhead h (cdr l)))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a possible list of codons given a protein sequence. Basically,
Basically, I would like to decode a given HTML document, and replace all special
there's something I can't get my head round... Basically I'm given the following data
What I am trying to do is create ideally a nested List basically a
Hoping I can get some architectural advice on this. I have been given the
Basically i just want to do an arbitrary operation using given arguments of arbitrary
Basically, i have a program that is given a 4 meg compressed file, it
Given an app called ExampleApp, I want to find ~/Library/Logs/ExampleApp basically without using hard
I'm trying to do some very basic time math - basically, given inputs of
What is the best method to create a database for the given example model

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.