mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-21 22:05:46 +02:00
More fixes
This commit is contained in:
@@ -188,7 +188,7 @@ x := Random new next; yourself. x next. "random number strea
|
|||||||
x := 100 atRandom. "quick random number"
|
x := 100 atRandom. "quick random number"
|
||||||
```
|
```
|
||||||
|
|
||||||
##Bitwise Manipulation:
|
## Bitwise Manipulation:
|
||||||
```
|
```
|
||||||
| b x |
|
| b x |
|
||||||
x := 16rFF bitAnd: 16r0F. "and bits"
|
x := 16rFF bitAnd: 16r0F. "and bits"
|
||||||
@@ -381,7 +381,9 @@ y := x asSet. "convert string to s
|
|||||||
y := x shuffled. "randomly shuffle string"
|
y := x shuffled. "randomly shuffle string"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Array: Fixed length collection
|
## Array:
|
||||||
|
Fixed length collection
|
||||||
|
|
||||||
- ByteArray: Array limited to byte elements (0-255)
|
- ByteArray: Array limited to byte elements (0-255)
|
||||||
- WordArray: Array limited to word elements (0-2^32)
|
- WordArray: Array limited to word elements (0-2^32)
|
||||||
|
|
||||||
@@ -424,7 +426,9 @@ y := x asBag. "convert to bag coll
|
|||||||
y := x asSet. "convert to set collection"
|
y := x asSet. "convert to set collection"
|
||||||
```
|
```
|
||||||
|
|
||||||
## OrderedCollection: acts like an expandable array
|
## OrderedCollection:
|
||||||
|
acts like an expandable array
|
||||||
|
|
||||||
```
|
```
|
||||||
| b x y sum max |
|
| b x y sum max |
|
||||||
x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements"
|
x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements"
|
||||||
@@ -616,7 +620,6 @@ y := x key.
|
|||||||
y := x value.
|
y := x value.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dictionary:
|
|
||||||
## IdentityDictionary:
|
## IdentityDictionary:
|
||||||
uses identity test (== rather than =)
|
uses identity test (== rather than =)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user