Comparing my Smalltalk and Eclipse Collections Wordle Kata Solutions

Challenge Yourself and Others to Learn

My Smalltalk Solutions

SUnit Test assertions for the Smalltalk version of the Wordle Checker Kata
SUnit Test assertions for the Smalltalk version of the Wordle Checker Kata

Smalltalk Solution #1

Smalltalk implementation of the guess method on a Wordle class
Smalltalk implementation of the guess method on a Wordle class
Smalltalk Collection hierarchy

Smalltalk Solution #2

Smalltalk implementation of the guessWithIndex method on a Wordle class

Update: May 10, 2022

Two dimensional array containing the test data and expected results
The testGuess method
The testGuessWithIndexSelect method
Running tests for methods from the domain class

My Eclipse Collections Solutions

  • Create a Bag of characters that do not have direct positional matches between both String instances (hidden and guess)
  • Collect up one of three possible states for each character as a result String. Convert exact positional letter matches to uppercase, letter match in different position to lowercase, and no letter match to a “.”

Eclipse Collections Solution # 1

Eclipse Collections solution using injectIntoWithIndex and collectWithIndex

Eclipse Collections Solution #2

Eclipse Collections solution using rejectWithIndex and collectWithIndex

Eclipse Collections Solution #3

From Wordle Kata Solutions to EC Integration Test

Comparing the solutions

Intersection and Differences between Smalltalk and Eclipse Collections methods
The preference for withIndexCollect: over collectWithIndex: in Pharo Smalltalk

Summary

--

--

--

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building GraphQL API With .Net 5 — EF Core And Hot Chocolate

Phase 1 Project

Write your first Code on Windows Subsystem for Linux.

On the Base of Knowledge… and Data

How cell reference locking works

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Raab

Donald Raab

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.

More from Medium

Compiling and running Java Source code using GraalVM and Oracle Java Development Kit

Sample code for IBM Event Streams Coding Challenge

Open-source SPL script make microservices develop more efficient

Never write Getters/Setters again! 😍