NLinker icon

Pattern Matchinb type tests

NLinker | PRO | 06/24/13 06:40:50 AM UTC | 0 ⭐ | 5475 👁️ | Never ⏰ | []
Scala |

1.1 KB

|

None

|

0 👍

/

0 👎

import scala.util.parsing.json.JSON
 
object Test extends App {
  val tree = JSON parseFull """[10, true, "ok", {"no":"yes"}]"""
  //val tree = JSON parseFull """{
  //     "x": 10,
  //     "xs": [ 1, 2, 3 ],
  //     "ys": { "a": "A", "b": "B" },
  //     10: 22}"""
  //> tree  : Option[Any] = Some(Map(x -> 10.0, xs -> List(1.0, 2.0, 3.0), ys -> M
  //| ap(a -> A, b -> B)))
 
 
  tree match {
    case Some(map : Map[String, Any]) => {
      val keyValues = for {
        k <- map.keySet
      } yield (k.toLowerCase, map(k))
      println(keyValues)
    }
    case Some(list: List[Any]) => {
      val values = for {
        e <- list
      } yield (e, e.getClass)
      println(values)
    }
    case _ => println("JSON object needed")
  }                                               //> Set((x,10.0), (xs,List(1.0, 2.0, 3.0)), (ys,Map(a -> A, b -> B)))
 
  println(matchTest("two"))
  println(matchTest("test"))
  println(matchTest(1))
 
  def matchTest(x: Any): Any = x match {
    case 1 => "one"
    case "two" => 2
    case y: Int => "scala.Int"
    case _ => "many"
  }
 
}

Comments

  • Vartotir icon
    03/30/26 01:57:32 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎