Welcome to the Book of Softcode Challenges!
The goal of this book is to present a set of projects for softcoding in a graduated order of difficulty/challenge. The idea is that a new softcoder could undertake each of these challenges in order and develop new skills by learning the techniques necessary for doing each.
You can contribute to this book in several ways!
You can write a challenge page, and try to clearly outline a project for a coder to do. Please specify your estimate of the difficulty of this project as:
You can comment on a challenge page to make suggestions to improve it.
You can even post softcode snippets or entire objects that meet the challenge, as examples to others.
Javelin will edit things into their proper order and organization in this book.
Go to it!
The projects in this section are designed to teach very basic softcode concepts.
Most MUSHes create players relatively "blank" and homogenous. The goal of this challenge is to make your player work better.
Some help files related to this challenge are:
This coding challenge by: Trispis
Challenge: Create a potted plant.
The potted plant should be an object that can be looked at, picked up, and dropped. When a player interacts with the plant in one of these ways, it should give appropriate feedback to the player. For example:
> get potted plant
You carefully pick up a potted plant.
> drop plant
That might break it, so you set it down gently instead.
Other players in the same room should also see messages for the interactions, such as:
"Trispis sets down a potted plant."
Relevant help files for this challenge are:
Challenged proposed by: Trispis
These projects are designed for those who've mastered beginning mush skills, but have little coding experience.
The goal of this challenge is to create an exit that allows PLAYERs to pass through, but prevents THINGs from passing through.
The exit should have an appropriate description. A player passing through the exit should get feedback, as should other observers on either side of the exit. A thing failing to pass through the next should cause observers to get feedback on the attempt.
*Extra Challenge*: Allow players and Puppets, but no other things, to pass.
Relevant help files:
I think the challenge can easily be done with the above. If you want to dabble with various types of locks (rather than flag or object type locks), consider an evaluation lock - here are some initial pointers for help files relevant to an evaluation type of lock...
This coding challenge by: Trispis
These projects are designed for coders with some experience. They are intended to help introduce less common or more powerful functions and coding idioms.
The goal of this challenge is to create a softcoded communications system that involves a single object with a single channel. You may assume that this object will be placed in a zone master room, and all the players using it will be in rooms in that zone. Another way to look at this challenge is that you're creating a way for players to shout across a zone.
The object should allow people to join or leave the channel. Players who have joined the channel should be able to send messages on the channel, which should be heard by all other players on the channel. Players should also be able to get a list of all the players who are on the channel.
*Extra Challenge*: Handle regular messages as speech, but handle messages starting with a colon (:) as remote poses.
*Extra Challenge*: Add a second chat channel, and do it in way that would make it easy to add more channels. Players should be able to do everything with the second that they could with the first, and should also be able to get a list of all the channels in the system.
This coding challenge by: Talvo
The object of this challenge is to create a function system that uses a stopwatch style timer similar to standard wait() command.
However, it should be universal (Accepting any input for either of the styles of running the system shown below), cleanly repeatable in a looping fashion, and finish cleanly.
Thus, you should be able to do either:
---
Repeat '[pemit(%#,[time()])]' every 15 minutes for the next 2 hours, then stopping the loop cleanly.
---
or:
---
After running '@eval [setq(1,0)]'
Repeat '[setq(1,[add(%q1,1)])]' every 5 minutes until %q1 = 10, then stopping the loop cleanly.
---
Both of these things should be able to be done by the user, utilizing your system.
Potentially useful commands/functions you may or may not wish to consider: @wait, @notify, @drain, @trigger, @halt, until(), while(), secs(), time(), convsecs(), convtime(), timefmt(), @function (wizhelp for that one)
Extra Challenge: Create the system to only need one function for either of the styles of use.
Extra Challenge: Allow the system to work either as a function or added @command.
Extra Challenge: Perform the challenge without use of @halt.
---
Elraver
These challenges involve larger or trickier projects that require coordination of multiple objects.
The goal of this challenge is to produce a set of radio (or walkie-talkie) objects that are multichannel, multicast devices -- each radio may be tuned to a single frequency at a time, and will receive any broadcast made on the same frequency.
A radio object is different from a chat channel because it is an *object* that can be given, dropped, etc. The radio should have three volume levels: off (nothing received is broadcast), normal (anything received is emitted to the location of the radio, which may be a player), and loud (anything received is emitted to the location of the radio and to the container of the location of the radio).
*Extra challenge*: Make a scanner that can receive multiple frequencies.
*Extra challenge*: Add an encryption system to the radios so that if an encryption key is set, other radios receive garbled text unless they have same encryption key set. The garbled text, ideally, should not be random but text that would actually be susceptible to (human) cryptanalysis.
This coding challenge by: Javelin
The goal of this challenge is to implement the Slim Shady Algorithm.
Create a dozen or so listening objects that all exhibit similar responses to a trigger phrase ("Will the real Slim Shady please stand up?"). The responses should be triggered in a probabilistic fashion (e.g., when asked to stand up, there is a 50% chance that each object will stand up). These are the imposter Slim Shadys.
Create a single listening object with the same response to the trigger, but 90% of the time. This is the real Slim Shady.
Create an object that repeatedly asks for the real slim shady to please stand up, and keeps track of which objects respond how often. This object should repeat the algorithm and provide its best guess of which of the standing objects is the real Slim Shady.
This section includes challenges for expert softcoders. These typically reflect complex "systems-level" projects.
Totally pointless challenge of the day.
Write a fractal snapshot display. Capture a 'snapshot instant' of your fractal's evolution, and display it in some kind of "tie died" -looking display.