Questions tagged [racket-student-languages]

The Racket Student Languages are a set of small languages meant to be used with the book How to Design Programs. They include Beginning Student Language (BSL and BSL+), Intermediate Student Language (ISL), Intermediate Student Language with Lambda (ISL+), and Advanced Student Language (ASL)

41 questions
0
votes
1 answer

How to update list of structs inside another struct in Racket (Universe)

This is a homework assignment so I am not asking for code just guidance. I am new to Racket language and using ISL without lambda. I can't use lambda or any other libraries. I am using bigbang. I have a struct called struct-abc. Inside struct-abc,…
Abhinav
  • 11
  • 2
0
votes
1 answer

Basic Racket: End Values

I'm taking an intro programming class. We use the student languages in DrRacket. Problem: I would like to return a certain value at the end of a big-bang game (require 2htdp/universe)`. Current Output: When the game ends, DrRacket returns my current…
Julian
  • 23
  • 4
0
votes
1 answer

Stuck while writing a recursion function in racket beginner language?

So recently I learned recursive function and I am trying some exercise then I am just stuck. Question is list-nth-item, that consumes a list, (lst), and a natural number, (n), and produces the n-th element in lst if exists, otherwise the function…
Arya
  • 11
  • 9
0
votes
1 answer

In racket how do I replace word in string using string->list or list->string function only?

So I was practicing racket beginner language when I came along this question. Write a function str-replace which consumes a string, a target character, and a replacement character. The function produces a new string, which is identical to the…
Arya
  • 11
  • 9
0
votes
1 answer

How to pass variables to 'text' in racket

I have to create the above image The text inside is variable. What I mean is that I want to pass 2 values to it for display and these values keep changing. I am trying this: (define (circle-text vx vy) (underlay/align "center" …
user3868051
  • 1,147
  • 2
  • 22
  • 43
0
votes
1 answer

Need help understanding function in BSL (DrRacket)

Language BSL - DrRacket (racket variant) Problem: I need to understand what the function below does exactly. Specifically the substring bit, I don't understand how it determines whether a string has an "?" at the end in choosing whether to append…
0
votes
1 answer

How do I create a version of filter using map (racket ISL)

I am Tasked (in exercise 8) with creating a function in Intermediate Student Language (Racket) that receives a list of numbers and a list of lists of numbers; each list is the same length. Name the first list breakpoints and the second LoR (list of…
0
votes
1 answer

Scheme Beginning Student, Function Body Extra Part

I attempted to follow the solution provided in this question, but it simply didn't work. Essentially, my function works like so: (define (item-price size normal-addons premium-addons discount) (define price 0) (+ price (* normal-addon-cost…
Kade
  • 151
  • 1
  • 10
-1
votes
1 answer

Convert a list of char into a single string

If I have a list of char like (cons #\C (cons #\O (cons #\M (cons #\P (cons #\U (cons #\T (cons #\E empty))))))), how can I convert it into a string? I'm not allowed to use string-append, substring, implode, and explode. I am also on Beginning…
-1
votes
1 answer

Racket: Insert new nodes into a binary search tree

lets say we have a binary tree structure: (define-struct tree-node (left right node)) I'm having trouble with creating a binary search tree. My main problem is, I don't know how to insert a node into a tree or to overwrite left or right in…
-1
votes
2 answers

Can I divide list into multiple parts in BSL?

I have the list of values and want to take first x values from it and create (list (listof first x values) (listof next x values) and so on until this list gets empty...). For example, given this list: (list "a" "b" "c" "d" "e" "f" "g" "h"…
L.L
  • 1
1 2
3